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.

that sends a message to the receiver agent Id <strong>of</strong> some role type R to tell himthat the value <strong>of</strong> the belief Bel is the value <strong>of</strong> the expression BelExpr. Giventhat, we can check then that the specified Bel would be among those that areenlisted in the understands block <strong>of</strong> the role R and that the types <strong>of</strong> the beliefsare compatible. Examples <strong>of</strong> checks follow:/* compilation ok */tell newThreshold = 2 to: myThermostat/* error: aMsg is not understood by agent playing the Thermostat role */tell aMsg = "hello" to: myThermostat/* error: wrong type for the belief newThreshold told to a Thermostat*/tell newThreshold = "2" to: myThermostatFinally, some other kinds <strong>of</strong> errors can be checked in scripts at compile timethanks to the explicit declaration <strong>of</strong> beliefs (and their types), finding errors inplans about beliefs that are not declared neither as beliefs at the script level,nor as local beliefs <strong>of</strong> plans, nor as parameters <strong>of</strong> the task, or about that beliefsare assigned with expressions <strong>of</strong> wrong type.3.3 Typing the EnvironmentOn the environment side, we introduce the notion <strong>of</strong> artifact interface definingthe type <strong>of</strong> the artifacts, separated from its implementation provided by artifacttemplates. An artifact interface is identified by a name and includes the specification<strong>of</strong> (i) the observable properties, and <strong>of</strong> (ii) the operations provided by allthe artifacts implementing that interface—which correspond to the actions thatagent can do on those kind <strong>of</strong> artifacts.Fig. 2 on the right shows the definition <strong>of</strong> the artifacts used by Thermostatagents, namely Conditioner – representing the interface <strong>of</strong> conditioner devicesmodeled as artifacts, used by thermostat agents to heat or cool – Thermometer– used by agents to be aware <strong>of</strong> the current temperature – and UserView –representing the interface <strong>of</strong> those GUI artifacts used to interact with the humanusers, in particular to know what is the desired temperature.The introduction <strong>of</strong> an explicit notion <strong>of</strong> type for artifacts allows us to definea way to address two main issues: (a) on the agent side, checking errors aboutthe actions (i.e. artifacts operations) and percepts (related to artifacts observablestate); (b) on the environment side, checking errors in artifact templates (i.e., theimplementation), checking that it conforms to its specification (the interface).In simpAL, the former case concerns checking the action (rules) in plan bodies,so that for each action OpName (Params ) on Target , specified in an actionrule, meaning the execution <strong>of</strong> an operation OpName over an artifact identifierT arget whose type is I:– there must exist an operation defined in the interface I matching the operationrequest;142

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

Saved successfully!

Ooh no, something went wrong!