--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.
Patrick / Srirama,please find attached (as a reference) my Gama project complete with shapefile. I've cobbled this together based on information here on the forums, the Gama wiki and the tutorials.The model places a car at the first of 4 markers on the map. The car then travels from marker 1 to 2, 2 to 3 and this goes along just fine. However when the car attempts to travel to marker 4 from 3 it begins to travel in a manner I can't explain. My hope is that you can tell me what is going on and where I have gone wrong.
Sincerely,
Jason
On Tuesday, January 20, 2015 at 1:22:21 AM UTC, Patrick Taillandier wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.
species TourCar skills: [moving]
{
//other variables
list<geometry> trail;
//other things
reflex move when: waypoint != nil
{
// move toward the current waypoint
path the_path <- self goto [target::waypoint, on::roadNetwork, return_path::true];
list<geometry> segments <- the_path.segments;
trail <- trail + segments;
loop seg over: segments
{
// record the distance traveled
totalActualDistance <- totalActualDistance + seg.perimeter;
}
if location = waypoint
{
point acrs <- CRS_transform(startingPoint).location;
point bcrs <- CRS_transform(waypoint).location;
int travelTime <- int(time - waypointSetTime); // how long have we been traveling toward the current waypoint
write ("Completed travel from " + acrs + " to " + bcrs + " which took " + travelTime + " seconds to go " + totalActualDistance + " meters");
totalActualDistance <- 0.0;
do incrementWaypoint;
}
}
}
display city_display type: opengl refresh_every: 1
{
species TourCar aspect: base;
species Marker aspect: base;
species Road aspect: base refresh:false;
graphics "trail" {
loop t over: TourCar {
loop g over: t.trail {
draw g color: #red;
}
}
}
}