0
votes

I am modeling an development process where projects (Epics) come from the Source and are broken down into their components (Features) that go through development. Once those components (Features) are completed the project (Epic) is complete. Here are the model detail (see screen shot too). enter image description here

  1. Epics agents (main project) leave the source and are copied with a random number of copies by the Split block into Features agents (the components of the main project).
  2. Epics agent is linked bi-directionally with Feature agent. At "On exit copy" the connection is made with "agent.ConnectTo(original)".
  3. The Feature agents then move to one of 2 Service block for development based in the probability set in a SelectOutput.
  4. The Epic moves immediately to a Wait (epicWait) and will remain there until all the copied agents (Feature) have moved through their development Service blocks.
  5. When an Feature leaves the development Service it goes to a Wait block (featureWait1 or 2) where it needs to check to see if all the Feature agents that went to the other development block are complete. If so the Feature agent should free itself, the other Feature agents in the other featureWait, and the matching Epic agent that is waiting in the epicWait. This signifies the project (Epic) is complete.

So my questions are how do I write the On Enter function to check the other featureWait block for other linked Feature agents? And then how do I free them to signify the epic is now complete? Thanks,

1

1 Answers

0
votes

What I would do instead of using featureWait1 and 2, on the sinkFeature1 and 2 I would do

if(agent.EpicLink.getConnectedAgent().featureLink.getConnectionsNumber()==1){
    epicWait.free(agent.EpicLink.getConnectedAgent());
}
agent.EpicLink.disconnect();

where epicLink represents the connection in the feature agent that is the connection to the associated epic