Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Count MUs at Store

Pioneer
Pioneer

Dear Team,

 

I use the STORE on 4 different stages on my simulation.

The MU´s going to the Store (scrap_Job -> Mu´s on Carrier // Scrap_part-> only MU´s), needs to be count in a table (production_program).

 

How can I count different Mu´s at a Store?

 

Thanks for your help

3 REPLIES 3

Re: Count MUs at Store

Experimenter
Experimenter

Hello A-Sim,

Define different global variables for different attributes. And at the entrance of a Store write a entry point method by identifying the attribute and add it to a count function.

Regards,

Yadav

Re: Count MUs at Store

Pioneer
Pioneer

Thanks Yadav,

 

I have tried your suggestion.

However, the Method "Count" is only counting the first Entity in the Store. All other parts are not going to be considered.

I tried to include a for loop but this didn´t help. What do I need to do, that all occupied places at the Store are going to be considered?

 

Thank you

AM-SIM

Re: Count MUs at Store

Phenom
Phenom

Amongst others you forgot to address the part locations / indexes in the store.

 

The code below works.

 

1. Cosmetics -> Rename your table to T_production_program (also in init method)

2.The count method should be executed only once at the end of the simulation.

Therefore delete it from the store entrance.

 

 

var CL : table[object]

scrap_part.ContentsList(CL)

vEntity1:=0
vEntity11:=0
vEntity12:=0


for var i:= 1 to CL.xdim loop
	for var j:= 1 to CL.ydim loop
		
		if CL[i,j].name = "Entity1" then
			vEntity1+=1
	T_production_program[5,1] := vEntity1	
	else 
		print "leer"
		
	end
	
	if CL[i,j].name = "Entity11" then
		vEntity11+=1
	T_production_program[5,2] := vEntity11
	else 
		print "leer"
		
	end
	
	if CL[i,j].name = "Entity12" then
		vEntity12+=1
	T_production_program[5,3] := vEntity12 
	else 
		print "leer"
		
	end
	
	next

next