0

I am currently trying to model a set of stores with the following Agents:

  • Customers
  • Employees

I want to utilise a state chart to show what role (service) the employee is currently undertaking

  • Cashier
  • Inventory

However, I cannot find any way to access the Employee agent when it's being utilised by a service, all of the method in the service's "Actions" section refer to the Customer agent.

When Employees are not being used, they are held in a Resource Pool. Customers are injected into an entry point from the top-level agent.

In essence, when the Employee agent is working at a service, I want to be able to set its statechart to reflect what service it is being used in.

1 Answers1

0

you can access the employee on the "on seize unit" of the service block by using the following synthax

((Employee)unit).statechart

the unit variable represents your employee, but since unit is actually defined as a general agent, you need to cast it into the type you want, that's why you do ((Employee)unit) from there you can access anything you want from the employee agent

Felipe
  • 8,311
  • 2
  • 15
  • 31
  • This is very helpful and greatly appreciated. One thing I noticed is that the service itself has no on release action, lo and behold I found it in the resource pool! – dispris May 18 '20 at 03:25