Skip to main content



      Home
Home » Archived » AMP » integrating real time data with eclipse abm platform
Re: integrating real time data with eclipse abm platform [message #733552 is a reply to message #733403] Tue, 04 October 2011 23:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Thank You for the prompt reply. Actually my concern is this. For each agent, if I have a data base of real movements and if I have already converted them into movements in (x,y) space with appropriate time stamps, could I include that to describe the movements of the agents rather than applying a random movement with out involving a GIS layer. For example agent K start its journey from point (x1,y1) at time t = t1 and it comes to point (x2,y2) at time t = t5 and so on.

Re: integrating real time data with eclipse abm platform [message #733553 is a reply to message #733552] Tue, 04 October 2011 23:10 Go to previous messageGo to next message
Eclipse UserFriend
samitha wrote on Tue, 04 October 2011 23:05
Hi,

Thank You for the prompt reply. Actually my concern is this. For each agent, if I have a data base of real movements and if I have already converted them into movements in (x,y) space with appropriate time stamps, could I include that to describe the movements of the agents rather than applying a random movement with out involving a GIS layer. For example agent K start its journey from point (x1,y1) at time t = t1 and it comes to point (x2,y2) at time t = t5 and so on.



Oh yeah, that would totally work. Smile You'd probably want some custom java in there to accomplish but it shouldn't be too difficult. Check out the Ascape API docs, but basically you can just do:

Method:

//some routine to get x,y given period t..
agent.moveTo(new Coordinate2DDiscrete(x, y));

Re: integrating real time data with eclipse abm platform [message #734175 is a reply to message #733553] Thu, 06 October 2011 19:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

It's me again. If I'm going to modify one of your sample models to check this say "EpidemicContact" , will modifying "public void initializeLocation()" and "public void movement()" in java code do the job? Or is it much complex than that?
Re: integrating real time data with eclipse abm platform [message #734185 is a reply to message #734175] Thu, 06 October 2011 20:19 Go to previous messageGo to next message
Eclipse UserFriend
samitha wrote on Thu, 06 October 2011 19:33
It's me again. If I'm going to modify one of your sample models to check this say "EpidemicContact" , will modifying "public void initializeLocation()" and "public void movement()" in java code do the job? Or is it much complex than that?


No, you've got it exactly right. If you're using a Modeling project (i.e. not just plain Ascape) make sure to do it in a subclass so that the project builder won't end up writing over your code! (You could just move the code to a non-Modeling project as well.)
Re: integrating real time data with eclipse abm platform [message #734194 is a reply to message #734185] Thu, 06 October 2011 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I'm using a escape model. Little bit confused with what you referred as a Modeling Project as I started working on the eclipse abm platform exactly week ago.

Now those two methods are in a class called "Individual". Should I make them empty methods and override them in a sub class of Individual Class? In that case do I need to modify the .metaabm file also. Also I have a doubt once I modify it whether rest of the things will work or not Smile Currently the two methods are as follows.

##########################################################################################3

public void initializeLocation() {
Object cityLocation = (Object) ((org.ascape.model.space.Discrete) getEpidemic()
.getCity().getSpace()).findRandomAvailable();
if (cityLocation != null) {
if (getHostScape() != ((Agent) cityLocation).getScape()) {
die();
getEpidemic().getIndividualScape().add(this);
}
moveTo(((HostCell) cityLocation));
}
}

######################################################################################

public void movement() {
double movementDraw = getRandom().nextDouble();
if ((getStatus() != StatusEnum.dead
&& movementDraw < getEpidemic().getMovementProbability()
&& getStatus() != StatusEnum.symptomInfectious && movementDraw < getEpidemic()
.getMovementProbability())) {
Object neighboringLocation = (Object) ((org.ascape.model.space.Discrete) getEpidemic()
.getCity().getSpace())
.findRandomAvailableNeighbor(((org.ascape.model.CellOccupant) this)
.getHostCell());
if (neighboringLocation != null) {
if (getHostScape() != ((Agent) neighboringLocation).getScape()) {
die();
getEpidemic().getIndividualScape().add(this);
}
moveTo(((HostCell) neighboringLocation));
}
}
}
Re: integrating real time data with eclipse abm platform [message #734196 is a reply to message #734194] Thu, 06 October 2011 21:39 Go to previous message
Eclipse UserFriend
samitha wrote on Thu, 06 October 2011 21:32
Hi,

I'm using a escape model. Little bit confused with what you referred as a Modeling Project as I started working on the eclipse abm platform exactly week ago.


You can do a straight Escape project or and Escape Modeling project. If you do the latter you could have the issues you describe below. See the description in the action references below for one good way of doing that. Basically you just delegate the method out to a static class somewhere so you don't have to hassle with code generation, protected regions etc...

http://www.eclipse.org/amp/documentation/contents/Modeler_Guide.html#Reference_2

Note that you should probably just create a copy of the Epidemic model and make sure you change the package name (in the root context) so that the two models won't both be generated to the same place.

Quote:
Now those two methods are in a class called "Individual". Should I make them empty methods and override them in a sub class of Individual Class?


See above for a better way of doing this.

hth!


Previous Topic:Call for feature requests
Next Topic:Debugging an escape model
Goto Forum:
  


Current Time: Wed Aug 06 02:34:16 EDT 2025

Powered by FUDForum. Page generated in 0.05013 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top