0

I am generating multiple agents at the source. I would like to let them wait until some event.

I am trying to access the "delay.stopDelay(agent)" however it requires an agent as a parameter.

How should I proceed?

enter image description here

WillEnsaba
  • 756
  • 1
  • 8
  • 23

1 Answers1

0

Here is the answer:

Tasks t = null; 
if(delayTasks.size()>0){

    //use a random agent stored at delayTasks
    int i = uniform_discr(0, delayTasks.size()-1); 
    t=delayTasks.get(i); 

    //or use any specific condition
    for(int i=0; i< delayTasks.size(); i++){ 
    //if() any condition
        t=delayTasks.get(i); 
    } 

    //Then you release the agent t
    if(...){
        delayTasks.stopDelay(t);
    }
}
WillEnsaba
  • 756
  • 1
  • 8
  • 23