Showing results for 
Search instead for 
Do you mean 
Reply

How to count how many times a MU has past a single proc?

Hi,

 

I have a source that creates 3 types of MUs. After the source I want one the types of Mu to pass a serie of single procs twice and two other types of MUs to pass the serie only once.

 

So I tried to formulate a method for counting the number of times a MU has passed a single proc (inserted in the entrance-control of machine 1):

 

is
do
@.MU.spheres.count:= @.MU.spheres.count+1;
end;

 

and a method for exit-control:

 

is
do
if @.count > 1
then
@.move(location1);
else
@.move(location2);
end;
end;

 

I gave all the entities a user defined attribute named count with the value 0 for the one that has to run the series twice and 1 for the attributes that has to pass the series only once.

 

However, in my case the attribute of the MU becomes the number of MUs that have past this station instead of the time the MU has past the station. In addition the simtalk of the exit strategy gives a default around the if line. Please help me, what is going wrong?

 

 

Thanks,

Karen

 

Greets Karen

1 REPLY

Re: How to count how many times a MU has past a single proc?

this:
is
do
@.MU.spheres.count:= @.MU.spheres.count+1;
end;

should cause an error

@ is already the MU, that calls the entrance control; if you have defined an attribute count in the MU, the program should look like this:

is
do
@.count:= @.count+1;
end;

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net