A tutorial of the R&B ToolkitRational and Behavioral reasoning in Assistant AgentsJ-P Sansonnet, 4 dec, 2009 - beta version - Release 0.9You need some basic knowledge about the interface of the front ends of Mathematca to understand this tutorial.This file contains Mathematica code that can be freely edited and executed.To Evaluate the code of the examples in this notebook do the following:1) Put the good path to the R&B directory on your computer like in the example just above;2) Do MENU Evaluation / 'Evaluate Initialisation Cells' and then evaluate the cells that launch the examples inLightYellowTHERNBPATH "E:\\RNB\\"; change only this line THEDATAPATH THERNBPATH "DATA\\";THESOUNDPATH "SOUNDS\\";THEPICTPATH "PICTS\\";Get THERNBPATH "rnb code.m" A Simple Model: Todoü The model of todoü The Simulation panel of todoA more complex model: Robbieü The model of Robbieã PresentationRobbie is very simple robot that walks in a 3x3 cell room and can go outside (through a door) in order to eat a piece of cake.In the room, there are some physical objects: 2 keys (one opens the door) and a cup of coffee.The basic situation at T0 is like illustrated in the following figure:2 rnb-tutorial.nbã Model structure : MODELROBBIEThe model of Robbie is defined by the following code, stored in the variable MODELROBBIE.Then, it can be compiled into the BASE by the function: MAKEMODEL[MODELROBBIE]After that, a simulation can be launched by ...
You need some basic knowledge about the interface of the front ends of Mathematca to understand this tutorial.
This file containsMathematicacode that can be freely edited and executed. To Evaluate the code of the examples in this notebook do the following: 1) Put the good path to the R&B directory on your computer like in the example just above; 2) Do MENU Evaluation / 'Evaluate Initialisation Cells' and then evaluate the cells that launch the examples in LightYellow
THERNBPATH"E:\\RNB\\";change only this line THEDATAPATHTHERNBPATH"DATA\\"; THESOUNDPATHTHERNBPATH"SOUNDS\\"; THEPICTPATHTHERNBPATH"PICTS\\"; GetTHERNBPATH"rnbcode.m"
A Simple Model: Todo
üThe model of todo
üThe Simulation panel of todo
A more complex model: Robbie
üThe model of Robbie
ãPresentation
Robbie is very simple robot that walks in a 3x3 cell room and can go outside (through a door) in order to eat a piece of cake. In the room, there are some physical objects: 2 keys (one opens the door) and a cup of coffee. The basic situation at T0 is like illustrated in the following figure:
2 rnbtutorial.nb
ãModel structure : MODELROBBIE
The model of Robbie is defined by the following code, stored in the variable MODELROBBIE. Then, it can be compiled into the BASE by the function: MAKEMODEL[MODELROBBIE] After that, a simulation can be launched by the function: DISPLAYSIMULATIONPANEL[MODELROBBIE, 10, 0.1] (see below for arguments 10 and 0.1)
If you evaluate the following cell, you will create the BASE that contains the model (the list is the identifiers/symbols of the specificentities conatined in the model)
In order to see the simualtion prperly you have to open a large window with at least 1200 pixels width, otherwise the simaula tion panel will be jaggered
ãSimulation panel
The simulation panel is displayed at T0 by DISPLAYSIMULATIONPANEL: argument 1: a model variable argument 2: initial value of STEP MAX argument 3: initial value of SPEED
SUB PANEL: RATIONAL AGENT The current plan is in the stack the alternative plans can be seleceted by clicking on one of the PLAN buttons within a plan, a particular action can be forced to execution (if possible at that moment) by clicking on one of the EXEC buttons POSS list the possible actions at any moment SOUND check box switches the sound if available on the machine TRACE switches the Print tracing under the simulation panel (low level tarcing!) SPEED sets the speed of the simulation STEP 0 to MAX makes n steps to be executed in a row PLAY is the button that launches the n steps of the simulation (stops when goal is achieved) STOP/START suspends and resumes PLAY RESET resets the simulation panel to intial state T0. SUB PANEL SIMULATION show the topology , the objects etc. can be clicked or any interaction SUB PANEL BEHAVIRAL AGENT ENGY = energy is the current value of the energy of the agent PLEA = pleasure is the current value of the pleasure of the agent CONF = confidence is the current value of the confidence of the agent EXP is the current list od the agent's expecteations DONE is the current list of the achieved expectations from EXP
ãSimulation at T0
Here is the simulation at T0 You can click on PLAY to launch it
6 rnbtutorial.nb
DISPLAYSIMULATIONPANELMODELROBBIE, 10, 0.1
NOTE: This panel has been converted to bitmap format for the pdf export of the tutorial
ãSimulation at T0+10
Here is the simulation at T0 The mission is not completely accomplished. NOTE: the cell of the panel has been converted to literal (because of the Dynamics inMathematica). Don't click on PLAY.
DISPLAYSIMULATIONPANELMODELROBBIE, 10, 0.1
NOTE: This panel has been converted to bitmap format for the pdf export of the tutorial
ãSimulation at T0+20
Here is the simulation at T0 The mission is accomplished! NOTE: the cell of the panel has been converted to literal (because of the Dynamics inMathematica). Don't click on PLAY.
DISPLAYSIMULATIONPANELMODELROBBIE, 20, 0.1
NOTE: This panel has been converted to bitmap format for the pdf export of the tutorial
ãSome tests
You can see, at a given moment, the content of the BASE. Here is the current state of the information about the key k2