23.08.2015 Views

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

would report an error message about missing a plan for a declared task, i.e.KeepTemperature.The second case concerns checking tasks assigned to an agent <strong>of</strong> type R,i.e. which is expected to play the role R. Task assignment can be done in twoways. The first is through a predefined communicative action do-task done byany agent specifying the typed identifier <strong>of</strong> the task recipient:do-task TaskTodo task-recipient: IdThe second is through a pre-defined internal action with the same name, withoutspecifying the target agent, so as for an agent to allocate the task to himself.In both cases, the action completes as soon as the task has been done or it hasfailed 4 . Given this, we can enforce that:– given a belief Id <strong>of</strong> type R, storing the identifier <strong>of</strong> some agent playing therole R, then for any communication action do-task t task-recipient: Id thatsends a message to the target agent to assign him the task t, there mustexist a task type T in R such that t is a value (instance) <strong>of</strong> T .Then, given a fragment <strong>of</strong> a script with e.g. a belief myThermostat declared <strong>of</strong>type Thermostat, we have the following list <strong>of</strong> the main kind <strong>of</strong> errors that canbe caught at compile time:/* compilation ok */do-task AchieveTemperature( targetTemp: 21 ) task-recipient: myThermostat/* error: no tasks matching CleanTheRoom in role Thermostat */do-task CleanTheRoom() task-recipient: myThermostat/* error: no targetT param in AchieveTemperature */do-task AchieveTemperature( targetT: 21 ) task-recipient: myThermostat/* error: wrong type for the param value targetTemp */do-task AchieveTemperature( targetTemp: "21" ) task-recipient: myThermostatThe definition <strong>of</strong> role types includes also the type <strong>of</strong> messages that can besent to an agent playing the role, in particular what kind <strong>of</strong> beliefs can be toldby other agents. It can be declared by understands blocks. In the example,agents playing the Thermostat role can be told about the new threshold toadopt, which is represented by a belief newThreshold containing a value <strong>of</strong> typedouble (see lines 13-15 in Fig. 2). This declaration allows for checking at compiletime that the communicative actions <strong>of</strong> agents aiming at informing other agentsabout some belief. In simpAL this can be done by the communicative action:tell Bel = BelExpr to: Id4 in the case <strong>of</strong> the task assigned to another agent this is done by a message which isautomatically sent from the recipient to the task allocator.141

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!