![]() |
|
|||||||
| Simulation Analysis simulation software (Arena, AutoMod, Enterprise Dynamics, ExtendSim, PlantSim, ProModel, SIMUL8, WITNESS), input and output analysis, experimental design, optimization, simulation model verification and validation |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Consider that you are using 'Separate' in your model to create a copy (E2) of the original entity (E1). Afterwards E1 and E2 follow different paths (f.ex. they are going into two different submodels). At some point in your model, you want to change the value of the E1 attrubute (f.ex. aAttribute == 0 into aAttribute == 1) given that E2 had finished the process it has been directed to. The trick is that E1 can be at the different locations in the model so you cannot use MATCH block in all of them in a straight forward manner.
Is it possible to do this assignment? If yes, how? I was considering using VBA block together with a pointer to the entity. The problem is that I don't know other method of finding a pointer to the given entity location, different that the ActiveEntity Method. Any ideas? |
|
|||
|
I would consider defining another attribute to be used solely for the purpose of matching. An entity can have as many attributes as needed.
__________________
E. Williams, PMC |
|
|||
|
Signal and Hold would be perfect solution if one can be assured that E1 is already in a Hold module when E2 is sending a signal. It is not the case in the process I am modeling.
Last edited by Hirotaro; 06-10-2011 at 03:59 AM. |
|
|||
|
existing," he [url=http://www.ugamegold.com]wow gold[/url] hissed. I was dumfounded and [url=http://www.wowgold361.com]buy wow gold[/url] inattentive as the warning language [url=http://www.goldinstore.com]buy wow gold[/url] came in Prince's voice [url=http://www.goldmvp.com]cheap wow gold[/url] again, when I wasn't straight scared. "Soundless [url=http://www.runescape.com]rs gold[/url] now, Bella. Don't .
|
|
|||
|
[QUOTE=Hirotaro;8000]Consider that you are using 'Separate' in your model to create a copy (E2) of the original entity (E1). Afterwards E1 and E2 follow different paths (f.ex. they are going into two different submodels). At some point in your model, you want to change the value of the E1 attrubute (f.ex. aAttribute == 0 into aAttribute == 1) given that E2 had finished the process it has been directed to. The trick is that E1 can be at the different locations in the model so you cannot use MATCH block in all of them in a straight forward manner.
Is it possible to do this assignment? If yes, how? I was considering using VBA block together with a pointer to the entity. The problem is that I don't know other method of finding a pointer to the given entity location, different that the ActiveEntity Method. Any ideas?[/QUOTE] Just run into this thread, I guess you already have solution for your problem. Anyway, my rough idea is that you create a variable e.g, Flag which is equal to 0 before E2 finish the process and 1 after that (i.e. Flag is set to 1 by E2 after it finishes). In every relevant Assign block that E1 run into, just add one assignment aAttribute = Flag. The idea is not nice nor scalable but I think it may solve your problem in particular if there's not too many Assign blocks for E1 in your problem. |
|
|||
|
Variables can be indeed very useful in modeling this situation. Nevertheless, having thousands of successive entities in your model requires a very big variable. Therefore I was interested in better solution.
|
|
|||
|
For the problem of big number of entities you can use a 1D array variable says Flag(MaxSize). Then you have two attributes, aOwnIndex and aReferenceIndex. For the entities E1 and E2 in your example, the aOwnIndex of E1 is 1, of E2 is 2 and the aReferenceIndex of E1 is 2, of E2 is e.g 3. Then when the E2 finish, set the Flag(aOwnIndex) to 1 and in every Assign block for E1 (anyway you have to set the aAttribute somewhere) you set aAttribute = Flag(aReferenceIndex).
However there are still two big problems: First we have to decide what is the MaxSize? Maybe a good candidate is the (estimated) maximum entities that can be in the system? Second, how you index the entities, i.e. how you assign aOwnIndex and aReferenceIndex to each entity? I'm not sure if we can come up with nice solution here. In your example, we can have aOwnIndex = NumberOfEntitiesCreatedSoFar module MaxSize and aReferenceIndex = (aOwnIndex + 1) module MaxSize (i.e, we use circular reference, remember to reset the Flag(aReferenceIndex) in order to reuse it, e.g before you dispose E1, set Flag(aReferenceIndex) to 0) Anyway, it would be much better if we can avoid using variable and set the attribute in every Assign block. Last edited by lthoa; 11-16-2011 at 05:07 PM. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|