draw trajectory

45 views
Skip to first unread message

Suhad Faisal

unread,
Oct 30, 2014, 1:52:48 PM10/30/14
to gama-p...@googlegroups.com
Hello 

can I demand any example or note to draw the trajectory (path) of an agent 


thanks in advance

cheers
Suhad

Arnaud Grignard

unread,
Oct 31, 2014, 4:21:10 AM10/31/14
to gama-platform
Hi,

You can add something like that in the definition of your agent (you update the value of follow depending on which agent you want to follow

  list<point> trajectory <- [];

  bool follow <- true;


  reflex updateTrajectory {

    if follow{

      trajectory <- trajectory + location;

    }

   }


   aspect trajectory{

     if follow{

       draw line(trajectory) color:color;   

     }   

   }


And of course do not forget to add this aspect in one of your display

Arnaud

Suhad Faisal

unread,
Oct 31, 2014, 4:46:25 AM10/31/14
to gama-p...@googlegroups.com

many thanks dear Arnaud 

cheers
Suhad
Reply all
Reply to author
Forward
0 new messages