Jump to content

Search step in combination with Worker pools


Recommended Posts

Hi,


I have some trouble in using the search step in combination with Worker instances. If I use the search step to search for Worker populations (Worker instances that I have placed into the model), I don't get the whole populations, but the single Workers inside the population. How would I use the search step to get only the reference to the population, but not to the single Workers inside the population?


Thank you for any help.


Adrian.

Link to comment
Share on other sites

I don't think you can, not in the way you're thinking.


However, you could use the search step with a limit of infinity to get separate tokens for every worker of the population.


Alternatively, once you are associated with a worker, you can simply use something along the lines of 'Worker.Population....' to get the population functions. You don't even need the search step for this -- if you know the population you are searching, you can directly reference these functions with 'WorkerInstance.Population...'

Link to comment
Share on other sites

  • 1 month later...

Thanks for your help, which was useful.


I have now the following approach to dynamically get a WorkerPool using a Search-Step.


The first step was to build a new object definition "WorkerPool", which has as its only member a Worker.


The second step was then to place six instances of this "WorkerPool" class into the main model and to add all this WorkerPool-instances into a List of objects named "WorkerPoolList".


Finally, in the search step, I am searching through the WorkerPoolList for a specific instance of a WorkerPool. As the WorkerPool now is an object and not a Worker, the search step returns only the object.

356068899_Bild1.png.f95281bba62d75a34eeacf532c2f76b7.png

472169665_Bild2.png.99a971d78832868fb9dc23b5a0c24164.png

Link to comment
Share on other sites

×
×
  • Create New...