PDA

View Full Version : Two questions that are raised


David Chan
08-10-2008, 04:30 AM
There are 2 questions that were asked by one of lead
1. If a certain container with an ID could be identified and located from the model.
2. Beside the current dispatching rule on RTG dispatcher, could customised code be built?

Regards

David

Alex Christensen
08-11-2008, 08:56 AM
1. You could use for loops to search through your model for an item with the ID, but that would be slow and prone to null pointer exceptions which would cause it to stop the search early. It is possible do search your whole model, but I would recommend that when you create the item (in an OnCreation trigger, perhaps), set a global treenode pointer to it. Even when it moves around in the model, its location in memory won't change so a treenode pointer will still point to it.

2. I haven't worked with the RTG dispatcher much. It does have a variable called passto like a regular dispatcher. I am very unsure about this because the dll probably takes over, but maybe if you put some code in there it will change where it sends the tasksequences.

David Chan
08-11-2008, 09:48 PM
Alex,

1. I could not find anything information of the container when the container is placed into the yard. I guessed the information is put away till that container is retrieved from the yard again. Please advise if that is the way the model is designed.

2. There is no passto pick list from the RTG dispatcher. It has only "Extend Range based on:"

David

Alex Christensen
08-18-2008, 09:00 AM
1. You'll have to store your own pointer to it. In the attached model, I used a global variable to point to it. See the triggers of the source and the user event.

2. Like I said, I don't really know how the RTG dispatcher works. Maybe you could just use a regular dispatcher.

Anthony Johnson
08-18-2008, 10:20 AM
Alex,
Actually, in Flexsim CT, you can't store pointers to containers. Flexsim CT recycles the container objects, so once a container goes into a block, the object itself is recycled, and the data for the container is stored in a database.

To get information regarding where a container is, you'll need to use the getcontainerstat command, or to get the ids of containers in a block, you'll need to use the getblockstat command. Unfortunately, I don't know if we included the documentation for these commands in the last release, but we'll try to include that in the next one.

Also, the RTG dispatcher is a custom-designed object that uses a specific dispatch algorithm to try and make sure that RTG's do not cross over each other. Hence it can't give the user a straight "pass-to" field because it implements the pass-to itself. For now you must use one of the options that the RTG dispatch gives you.

There is, however, a "Custom" field available to you in the Resource Dispatch tab of the yard parameters window, and you can write custom code in that field as part of a rule in your resource dispatch strategy. In that field, the id of the container being stacked/unstacked is passed in as parval(1), so you can use getcontainerstat() with that id to get more information on that. The field should return a true or false as to whether that rule is a "match."

zhang xin
01-21-2010, 06:18 PM
"the data for the container is stored in a database."

could you tell me where is the database?

Phil BoBo
01-22-2010, 08:23 AM
In private memory. Use the getcontainerstat() command to get access to the information in it.