Sender: |
|
Date: |
Tue, 9 Jan 2007 09:16:14 -0500 |
MIME-version: |
1.0 (Apple Message framework v752.3) |
Reply-To: |
|
Content-type: |
text/plain; charset=US-ASCII; delsp=yes; format=flowed |
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-transfer-encoding: |
7bit |
Comments: |
|
Parts/Attachments: |
|
|
schedule.time() will return the current timestamp.
Sean
On Jan 9, 2007, at 6:46 AM, Jimmy Ong wrote:
> 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.
|
|
|