adrianloetscher Posted December 17, 2013 Share Posted December 17, 2013 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 More sharing options...
ASagan Posted December 18, 2013 Share Posted December 18, 2013 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 More sharing options...
adrianloetscher Posted January 29, 2014 Author Share Posted January 29, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts