NetLogo User Community Models
# WHAT IS IT?
This model uses extensions. Find the full model at: http://www.lifl.fr/SMAC/projects/ioda/ioda_for_netlogo/examples/rescue-the-princess.html
This model demonstrates goal-driven behaviors. The character (knight) can perform several interactions which are hierarchized so as to make it search and reach its goals. Basically the main goal of the knight is to rescue the princess which is somewhere in the maze. The knight can either have an exhaustive view (or "omniscient") of the maze, or on the contrary only see a small part and what has been explored. The state of the doors is not known before the knights explicitly checks wether they are locked, closed or open. When a door is locked, the appropriate key (i.e. with the matching color) is required. The knight uses a stack of goals so as to execute the appropriate actions.
The knight is also endowed with **personality traits** which influences the interactions that are chosen in a given situation and thus introduces diversity in the outcome of the simulation. The first one is the **mood**: an optimistic knight considers that doors which are still in an unknown state are easy to open, thus he takes them into account to compute the shortest path to his target. On the contrary, a pessimistic knight avoids doors with an unknown state as much as possible. The second personality trait is the **ordering of goals**. A rigid (psychotic ?) knight uses the stack of goals in a strict order, and must fulfill the first goal before it can take into account the other ones. On the contrary, a flexible use of the stack of goals allows to remove obsolete goals when a higher level target is reached (e.g. why matter opening all the doors when the princess is before you?). The last personality trait is the way to **execute the plan**.
# HOW TO USE IT
* Choose the the personality traits, the vision of the knight and a map of the maze, then click on **`setup`**.
# THINGS TO NOTICE
The behavior of the knight is not completely deterministic, since several goals or paths may be equivalent in terms of Dijkstra distance.
You can also draw you own maps in a text file. The first line is a comment or title, the second line is a list with the dimensions ([width height]) of the map, then each line encodes a line of the map: **W** for walls, ' ' for empty space, **K** for the knight, **P** for the princess, **B** (resp. **R**, **Y**, **G**) for the blue (resp. red, yellow, green) door, **b** (resp. **r**, **y**, **g**) for the blue (resp. red, yellow, green) key, **D** for closed (unlockable) doors.
# IODA NETLOGO FEATURES
This model makes an intensive use of one of the new features introduced in IODA 2.2: the ability to specify easily alternatives in the triggers or conditions of the interactions. For instance, please consider the "MoveTowards" interaction, which incites the knight to move in the direction of its goal when possible:
parallel interaction MoveTowards
The trigger simply verifies that the target of the interaction is the first goal of the knight. Yet, there are two possible conditions depending on the mood of the agent. In any case, the knight can perform MoveTowards if there is a free path (without obstacles) to the target. But, if the knight is optimistic, he will also try to move towards its goals if there is a "possible" path, i.e. through doors even in an unknown state.
# THINGS TO TRY
You can extend this model at will by introducing new personality traits and new characters. For instance, you can first try to use several knights and princesses (with the ability of being cooperative or not)! Or add a nasty dragon which can defeated only by brave knight (while cowards just flee). Have fun !
# HOW TO CITE
* The original "Princess" model was designed by Jean-Christophe Routier and Philippe
# COPYRIGHT NOTICE
All contents © 2008-2013 Sébastien PICAULT and Philippe MATHIEU
The IODA NetLogo extension is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
IODA NetLogo extension is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the IODA NetLogo extension. If not, see http://www.gnu.org/licenses.
(back to the NetLogo User Community Models)