Showing results for 
Search instead for 
Do you mean 
Reply

PRIORITY among successors

I have 2 successors(a,b) in 2 separate cases, I want to give priority to successor a in both cases but case -1 - mu should go to successor b if successor a is full. Case 2 -MU should go to successor b if more than 4 MUs in successor a. can someone help me with both these cases. How to write simtalk for this

2 REPLIES

Re: PRIORITY among successors

[ Edited ]

Assuming the "cases" are different MU types A and B, the code for the exit control could look like this:

var caseVar : string := @.Name
switch caseVar
case "A"
if ?.succ(1).full
@.move(?.succ(2))
else
@.move(?.succ(1))
end
case "B"
if ?.succ(1).numMU > 4
@.move(?.succ(2))
else
@.move(?.succ(1))
end
end

 

Re: PRIORITY among successors

will this work in plant simulation 12?