Jump to content

Search Step Problem


dburton
 Share

Recommended Posts

Hi Everyone


I seem to be having a problem with a search step with a transfer step following depending on whether a match is found. I'm sure this is due top my lack of understanding of tokens - apologies, I'm pretty new to Simio! As I understand it, the Search step creates a new token when the match criteria is found but retains the original token which continues through the process. I think the original token is causing the problem. I guess my question is; is there a way to suppress the original token (or destroy it) once the new token is play? I believe the original is trying to initiate an unwanted transfer step which is clashing with the wanted step, resulting in a runtime error. I've attached the error message which may help. Any help, advice or direction to texts explaining tokens would be very much appreciated.


.......Dave

445950705_ErrorMessage.JPG.db9771da3795cd52ec03af3139dee934.JPG

Link to comment
Share on other sites

By default found branch (token) is executed first and then the original. This is unless you have a delay in found branch. If so, (and the delay is at least math.epsilon) original token is executed before the delay and than found token executes.


If you can send a screenshot of your process it will be easier to give precise help.

Link to comment
Share on other sites

I have seen this error before with transporter/entity transfers...


You may have conflicting logic here....


i.e. an event occurs that triggers a token into a delay or wait step based on a condition before transfer can complete, yet during this duration another event occurs that wants the transfer to occur for a second time or the entity to be directed somewhere else...the original token is not released and destroyed first...


simple solution...


I used dummy nodes to shift the transporter\entities around based on a precedence constraint structure whilst clocking the time of the transporter\entity at each node. This worked like a bomb.


Also, if you don't need the original token, destroy it or don't attach any processes on the line after it.

Link to comment
Share on other sites

Hi again - One last question....

Is it possible to use the find step to search a variable array for more than one value? I can see how it is possible to search forwards and backwards, so possibly finding two matching values but am stumped when it is >2. Again any help or advice much appreciated.


Thanks..........Dave

Link to comment
Share on other sites

If you have an Index Variable Name named 'Testing' for example, you can initially set the 'Testing' value to 1 let's say to start the Find step. Within the Find step, you can have the Starting Index be 'Testing' (which would initially be 1) and Ending Index be the max value of the state variable dimension you are searching.


Then, when a matching value (based on your condition) is Found and you do whatever calculations using 'Testing' value (which would be the index into the array), you can Assign 'Testing' to be 'Testing+1' so that you start the search at that point in the vector/array, given you don't increase the value over the Ending Index. Then connect the Assign step back into the Find step to start the Find again, this time starting at the new starting index.

Link to comment
Share on other sites

 Share

×
×
  • Create New...