Subject: | |
From: | |
Reply To: | |
Date: | Tue, 9 Jan 2007 06:46:18 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi all,
I would like my agent to be able to keep track of "time" so that the
following scenario can be implemented:
Let's say I have 2 locations, home and workplace. The agent travels between
these 2 locations. At a certain time the agent will leave home for work, and
will reach the the workplace at time t. What time should the agent leave
home to be punctual for work?
The method that allows the agent to travel is taken from the example Virus:
protected void move() {
double dx = next.x - curr.x;
double dy = next.y - curr.y;
double d = Math.hypot(dx, dy);
if(step >= 1) {
dx /= d;
dy /= d;
}
sim.setObjectLocation(this, new Double2D(curr.x+dx, curr.y+dy));
} // end move
So the problem actually consists of the traveling time which is hard to
determine, since schedule.getSteps() is not a representation of the semantic
time.
So my main concern is how should my agent be able to keep track of time? Or
is there anyway that I can do it using the ticks (steps) of the scheduler?
Regards and thanks in advance,
Jim.
|
|
|