Search code examples
simulationanylogic

Problem with Seize "resource choice condition" in AnyLogic


I have an agent "customer" with the parameter "BatteryProblem" randomTrue (0.5), and I have an agent "Technician" with a population of 3. I am trying to assign one technique to solve only "BatteryProblem" and the other two techniques to solve the remaining problems that are not battery related?

My approach is given below:

  1. Create a variable inside technician agent called problemsSolved of type String.
  2. In the main agent, on startup, manually assign what each technician does. Like technicians(0).problemsSolved = "battery".
  3. In "custom resource choice" setting. Then the incoming agent can choose to only seize resources where unit.problemsSolved.equals("battery"). Like this;

Problem: I am having the error Description: problemsSolved cannot be resolved or is not a field. Location: tech/Main/seize - Seize

Screen Short of my model given below:

enter image description here

enter image description here

Just in case you need any further information feel free to ask.


Solution

  • Try the following instead:

    ((Technician)unit).problemsSolved.equals("battery")