Closed dhixsingh closed 6 years ago
One option is to return the coordinates of the from/to nodes the link is attached to and let the user application decide how to use the information that the agent is somewhere between those two points.
Discussed with @kainagel who will see if we can do anything better wrt estimating the agent's position on the link.
Commit f3fe7f1c641162b693db137fc7891726eef2d73b now returns the current location of the BDI agent in response to the REQUEST_LOCATION
percept query.
Since the exact location of the agent is not known on a MATSim link, what is returned is a Location[2]
giving the coordinates of the two nodes that the link is connected to. The interpretation is that the agent is somewhere on the line connecting these two points, and it is left to the application code decide what to do with this bit of uncertainty.
The relevant Resident
application code is here:
The associated output looks something like this:
...
Time 02078 Resident 30 : is blocked at link 51823
Time 02078 Resident 30 : is currently between locations (321543051, coords=251458.994864993,5892667.574804958) and (60303155, coords=251444.56941373763,5892815.969128571)
Time 02078 Resident 30 : will reevaluate route to destination (attempt 2 of 5)
Time 02078 Resident 30 : will start driving to shelter in (Castlemaine, coords=252145.230968,5894310.30443) at time 2083.0
...
/cc @osbornejr
The call to
queryPercept(agentId, "REQUEST_LOCATION", linkId)
should return the approximate coordinates of agentagentId
on the network linklinkId
./cc @osbornejr.