Björn Bringert, bringert@cs.chalmers.se
MapAgent is an OAA agent which displays a map showing a graph on top of a bakground image. The agent has solvables for drawing labelled edges on the map and for getting user clicks on nodes.
MapAgent is currently distributed as part of the tramdemo system.
MapAgent is currently geared towards transport networks and other systems which can be represented by a graph.
The agent is configured by a properties file. Here is an example of such a file:
graph: /gbg.dot clickThreshold: 20.0 backgroundImage: /mapbg.png
These are the properties used by MapAgent:
digraph { Harlanda [label = "Härlanda", pos = "900,720"]; Harlanda -> Redbergsplatsen [label = "1", dist = 2.0]; Harlanda -> OstraSjukhuset [label = "1", dist = 6.0]; Redbergsplatsen [label = "Redbergsplatsen", pos = "750,680"]; Redbergsplatsen -> Centralstationen [label = "1", dist = 6.0]; Redbergsplatsen -> Harlanda [label = "1", dist = 2.0]; ... }
NOTE: The path names in the properties file are Java resource names, so leading slashes mean to look in the root of the package hierarchy to find the file in the current directory.
If the map properties file is gbg.properties and the facilitator is running on $FAC_HOST, port $FAC_PORT, MapAgent is started with:
$ java -cp $CLASSPATH:tramdemo.jar se.chalmers.cs.gf.tramdemo.MapAgent /gbg.properties -oaa_connect "tcp('${FAC_HOST}',${FAC_PORT})"
The path to the properties file is a Java resource name, so the leading slash means to look in the root of the package hierarchy to find the file in the current directory.
$CLASSPATH must contain the paths to:
MapAgent declares these solvables:
draw(Instrs)
Clear map and draw edges with the label "1" from Gronsakstorget to Hagakyrkan and from Hagakyrkan to Jarntorget, and draw an edge with the label "6" from Chalmers to Korsvagen:
draw('clear; drawEdge (1, [Gronsakstorget, Hagakyrkan, Jarntorget]); drawEdge (6, [Jarntorget, Olivedalsgatan]);') => draw('clear; drawEdge (1, [Gronsakstorget, Hagakyrkan, Jarntorget]); drawEdge (6, [Jarntorget, Olivedalsgatan]);')
clicks(Clicks)
click(Nodes)
, where Nodes
is a list of
node labels that the click was close to.
No clicks available:
clicks(Clicks) => clicks([])
A single unambiguous click:
clicks(Clicks) => clicks([click(['Frihamnen'])])
An ambiguous click:
clicks(Clicks) => clicks([click(['Klareberg','Tagene'])])
Two unambigious clicks:
clicks(Clicks) => clicks([click(['Ullevi']),click(['Centralstationen'])])