Cancel
Showing results for 
Search instead for 
Did you mean: 

Weak performance when set-up time dependent on MU attribute compared to previous MU

Creator
Creator

Hi,

 

I am modeling a large production environment and create a huge number of entities. The source names them according to their main part and also adds some attributes via the mechanisms of delivery tables.

 

Along the production line there are three scenarios at every station:

  • Between entities which have the same name and also share a specific attribute value, there shall be no change-over time.
  • Between entities which have the same name but differ in their attribute value there shall be x seconds of change-over time.
  • Between entities which already differ in their name there shall be y seconds of change-over time.

 

I tried this code as entrance control to the different stations:

(vProductionArea is a variable inherent to every station (which are all subframes))

 

var stationName : String
stationName := current.name

var tTableA, tTableB : table
tTableA := ~.ImportMethods.tLeadTimes_raw[1,1][2,1]
tTableB := ~.ImportMethods.tLeadTimes_raw[1,1][1,1]

if pos("TL", vProductionArea)>0 and vLastHandledEntityName /= ""
	switch vProductionArea
	case "A Testing1"
		if @.name = vLastHandledEntityName 
			if @.InjectorType = vLastHandledInjectorType
			--same main part and same attribute
				?.SetupTime := 0
			else
			--same main part but different attribute
				?.SetupTime := str_to_time(tTableA[4,1][1,1])
			end
		else
			--main part type is different
			?.SetupTime := str_to_time(tTableA[4,1][2,1])
		end
	
	case "A Testing2"
		..same logic..	
case "A Testing3" ..same logic.. case "B Testing1" if @.name = vLastHandledEntityName if @.InjectorType = vLastHandledInjectorType --same main part and same attribute ?.SetupTime := 0 else --same main part but different attribute ?.SetupTime := str_to_time(tTableB[4,1][1,1]) end else --main part type is different ?.SetupTime := str_to_time(tTableB[4,1][2,1]) end case "B Testing2" ..same logic..
case "B Testing3" ..same logic.. else print ">>>>>>>>>mSetupTime: Thats strange. Found in the table and part of testing line but no C/O time available? " + stationName EventController.stop(false) end end vLastHandledEntityName := @.name vLastHandledInjectorType := @.InjectorType

 

 

However, it turned out to be extremely unperformant. I already brought down the routine from >85% according to the Profiler, but it still makes up for >30% of the simulation time. Converting the table columns into time-format to avoid conversion during actual simulation seems logic but I doubt that it brings enough benefit.

 

Do you have any recommendations how this task can be accomplished in a performant way? Smiley Happy

 

Thanks a lot in advance!

 

edit: 30 days simulation time produce ~3.6 million calls. So I'm very happy about every kind of suggestion. Moreover, since activating this method I am receiving a "Access violation error" message which shuts down the whole program. Smiley Sad