+{Page}Sequences ! 1 Start /04/21/2003 05:06:32.914 !---------------------------------------- +{Object.1} Sequences.[1]Start INTEGER:: intAlStat +{Trans} OPEN(21,FILE=WithPath("Results6.TXT")) OPEN(22,STATUS='SCRATCH') !----- READ(21,*)&B.Items REWIND 21 WRITE(21,*)&B.Items,"= Parameter for permutations" &B.Sequences = Factorial(&B.Items) WRITE(21,*)"Total sequences =",&B.Sequences !----- @B.Item = 0 &B.Sequence = 0 {?|&B.Sequences} !Echoes value of &B.Sequences with ??? and identifying label for easy search !----- ALLOCATE(bigSequence(&B.Sequences,&B.Items),STAT=intAlStat) !Table for storing sequences IF(intAlStat/=0)THEN CALL ErrMsg(9,0,"Error allocating memory for bigSequence") ENDIF !----- !Allocate starting surrogate's HasBeenAt mem and initialize all Items to logNo by default CALL InitHasBeenAt(bigSur,&B.Items) -{Trans} -{Object.1} Sequences.[1]Start !---------------------------------------- +{Object.3} Sequences.[3]SendToWhereNotBeen INTEGER(big):: bigIndx +{SignalTarget} @L.VisitedAllTasks = logYes !Presumption to be negated in loop below if not true DO bigIndx = 1, &B.Items !Signal threads to all Items/tasks not yet visited IF(HasBeenAt(bigSur,bigIndx))CYCLE !Check next Item/task @B.Item = bigIndx !Has not been to this task, so... @L.VisitedAllTasks = logNo !Means incoming surrogate will not traverse [6] {Signal.4} !Signal inherits all properties of incoming surrogate ENDDO -{SignalTarget} -{Object.3} Sequences.[3]SendToWhereNotBeen !---------------------------------------- +{Object.4} Sequences.[4]SendToWhereNotBeen--->|SendToWhereNotBeen +{Branch} {nop.L}Branch={logNo} !Branch traversed only by signals sent from [3] -{Branch} +{Trans} !Write (to global scratch string of 20 chars) task to which being sent WRITE(&20.LinePad,*)@B.Item CALL TravelNotes(bigSur,&20.LinePad) !Record travel (task to which being sent) CALL SetHasBeenAt(bigSur,logYes,@B.Item) !Label target task as being visited -{Trans} -{Object.4} Sequences.[4]SendToWhereNotBeen--->|SendToWhereNotBeen !---------------------------------------- +{Object.5} Sequences.[5]StoreSequence INTEGER(big):: bigIndx +{Trans} REWIND 22 CALL ShowTravelNotes(bigSur,22) !Write travel/visitation history to 22 REWIND 22 &B.Sequence = &B.Sequence + 1 DO bigIndx = 1, &B.Items READ(22,*)&B.Item bigSequence(&B.Sequence,bigIndx) = &B.Item ENDDO !Write current sequence vector from bigSequence table to file 21 WRITE(21,*)"Seq",&B.Sequence,":",bigSequence(&B.Sequence,:) -{Trans} -{Object.5} Sequences.[5]StoreSequence !---------------------------------------- +{Object.6} Sequences.[6]SendToWhereNotBeen--->|StoreSequence +{Branch} {nop.L}Branch={@L.VisitedAllTasks} !If this surrogate has been to all tasks/Items -{Branch} +{Trans} -{Trans} -{Object.6} Sequences.[6]SendToWhereNotBeen--->|StoreSequence -{Page}Sequences //////////////////////////////////////////