ASTRA Example: Belief Update

Belief Update

This final example illustrates how AgentSpeak(L) permits the modification of the agents internal state through the belief update plan operators.  The ASTRA equivalent is:

01 agent Uppy {
02     module Console C;
03
04     types uppy {
05         formula light(string);
06     }
07
08     initial light("on");
09
10     rule +light("on") {
11         C.println("the light is on, turn it off!");
12         -light("on");
13         +light("off");
14     }
15     
16     rule +light("off") {
17         C.println("the light is off, turn it on!");
18         -light("off");
19         +light("on");
20     }
21 }