This is a basic tutorial of how to use the CST Motivational System integrated with the Simulator of Urban MObility (SUMO). Here we explain how to develop a simple application that control traffic lights in a SUMO Simulation using the CST Motivational System (CST-MT). We will learn how the CST-MS works and what are its main classes. If you are a starter then we recommend first The Core Model Trail.
Simulator of Urban Mobility
Before entering into the details of our SUMO controller, your first need to know the basics about SUMO. The SUMO (Simulator of Urban MObility) traffic simulator is an open source suite which was developed by DLR - Institute of Transportation System and is avaliable since 2001. It allows the creation and simulation of traffic models including vehicles, public transportation and pedestrians. The SUMO platform offers many features such as:
- Microscopic simulation - vehicles, pedestrians and public transportation are modeled explicitly;
- Online interaction – control the simulation with TraCI. TraCI is the short term for "Traffic Control Interface". It is responsible for giving access and handling simulation objects and making available information about roads, vehicles and traffic signals. Using TraCI, it is possible to control traffic light states by means of external programs. TraCI uses a TCP based client/server architecture to provide access to SUMO in run-time;
- Simulation of multimodal traffic, e.g., vehicles, public transportation (buses, trains) and pedestrians;
- Time schedules of traffic lights can be imported or generated automatically by SUMO;
- No artificial limitations in network size and number of simulated vehicles;
- Supported import formats: OpenStreetMap, VISUM, VISSIM, NavTeq;
- SUMO is implemented in C++ and uses only portable libraries;
TraCI is a client/server TCP interface which can be used by any language. There are also proxies for different programming languages such as Python, Java, C# and C/C++, which internally uses TraCI to communicate with the SUMO simulation. This tutorial application was written in Java, and hence we used TraCI4J, a Java API for TraCI.
There is extensive literature about SUMO. We recommend particularly its wiki and this technical report written by our group.
The CST Motivational System
The CST Motivational System (CST-MS) implements a model of a human motivational mechanism. It was originally inspired on the motivational systems in CLARION and LIDA cognitive architectures. In the philosophy of CST, every processual piece of code in a cognitive architecture should be a codelet (Hofstadter & Mitchell 1994), and every piece of memory should be a MemoryObject. The CST-MS follows this basic principles, and the br.unicamp.cst.motivational package implements a set of classes which extend the Codelet class and a set of classes which extend the MemoryObject class. Similarly to CLARION, our CST-MS follows many ideas coming from the work of Hull (1943), Maslow (1943), Toates (1986), McFarland (1993) and others.
In the CST-MS there are two basic entities: Drives and Goals. They are motivational representations which can be classified as implict and explict in the motivational system. a Drive represent an inner need (implicit) of an agent such as hunger, thirstness, or danger avoidance. Each drive has an activation level which defines its importance. Furthermore, drives can be of three different types: primary low, primary high or secondary. Low level primary drives are related to primitive needs of an agent such as hunger, thirstness, the need to reproduce and to avoid danger. High level primary drives represent higher needs on Maslow's hierarchy, like: belongingness, esteem and self-actualization. Secondary level drives are drives which are not related directly to basic needs, but are derived from other drives. A simple example is the food opportunity sense. It uses other drives such as hunger and danger avoidance and combine them in order to become a drive in itself. A Goal is the representation of a different kind of motivation, while compared to a drive. While drives are perennial in the sense of a basic need, which must always be pursued, a goal is a tangible motivation for an action, which concludes as soon as a particular state is reached. Following Sun's categorization (Sun, 2009), Goals are explicit representations of motivations, while drives are implicit.