"penDown" functionality in Repast

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"penDown" functionality in Repast

lee talman
Hello all,

I am building an agent-based model in Repast Simphony 2.3. I have an agent that moves around a space and grid. I would like to track this agent's movement at each tick and have it display as a line that "trails" the agent. I have attempted to do this by placing an invisible node at each tick and drawing a network edge between the agent and this node, but I get fatal errors each time. I have looked into SimGraphics and Graphics2D but cannot figure out how to implement them in Repast Simphony. Is there a simple way to replicate the "penDown()" functionality built into Netlogo/ReLogo but in Repast Simphony? 

Lee Talman
Vascular & Tissue Systems Lab
Department of Biomedical Engineering
University of Virginia

(631) 680-7912

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "penDown" functionality in Repast

Ozik, Jonathan
Could you say more about the fatal errors you're seeing?

On Nov 13, 2016, at 10:20 PM, lee talman <[hidden email]> wrote:

Hello all,

I am building an agent-based model in Repast Simphony 2.3. I have an agent that moves around a space and grid. I would like to track this agent's movement at each tick and have it display as a line that "trails" the agent. I have attempted to do this by placing an invisible node at each tick and drawing a network edge between the agent and this node, but I get fatal errors each time. I have looked into SimGraphics and Graphics2D but cannot figure out how to implement them in Repast Simphony. Is there a simple way to replicate the "penDown()" functionality built into Netlogo/ReLogo but in Repast Simphony? 

Lee Talman
Vascular & Tissue Systems Lab
Department of Biomedical Engineering
University of Virginia

(631) 680-7912
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "penDown" functionality in Repast

lee talman
Hi Jonathan,

I appear to have fixed my issue. I did not define a network projection in the model context before attempting to add network edges, which was an obvious error. Additionally, I believe to have figured out how to code the functionality I was looking for. For everyone else who is interested, here is some psuedocode for the penDown() functionality:

define a 'breadcrumb' class to track motion
before an agent moves, add a breadcrumb to the context the agent's current location
perform the agent movement
after the agent moves, add a second breadcrumb (breadcrumb2) to the context at the agent's new location
define a networkedge that spans between breadcrumb and breadcrumb2

Now I simply have to figure out how to change the color of the edges between the breadcrumbs to be programmatic instead of one color set in the GUI, but that's a problem for another day. Thank you!
-Lee

Lee Talman
Vascular & Tissue Systems Lab
Department of Biomedical Engineering
University of Virginia

(631) 680-7912

On Tue, Nov 15, 2016 at 12:00 PM, Ozik, Jonathan <[hidden email]> wrote:
Could you say more about the fatal errors you're seeing?

On Nov 13, 2016, at 10:20 PM, lee talman <[hidden email]> wrote:

Hello all,

I am building an agent-based model in Repast Simphony 2.3. I have an agent that moves around a space and grid. I would like to track this agent's movement at each tick and have it display as a line that "trails" the agent. I have attempted to do this by placing an invisible node at each tick and drawing a network edge between the agent and this node, but I get fatal errors each time. I have looked into SimGraphics and Graphics2D but cannot figure out how to implement them in Repast Simphony. Is there a simple way to replicate the "penDown()" functionality built into Netlogo/ReLogo but in Repast Simphony? 

Lee Talman
Vascular & Tissue Systems Lab
Department of Biomedical Engineering
University of Virginia

<a href="tel:%28631%29%20680-7912" value="+16316807912" target="_blank">(631) 680-7912
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest



------------------------------------------------------------------------------

_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Loading...