MASON-INTEREST-L Archives

January 2007

MASON-INTEREST-L@LISTSERV.GMU.EDU

Options: Use Proportional Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Sean Luke <[log in to unmask]>
Reply To:
MASON Multiagent Simulation Toolkit <[log in to unmask]>
Date:
Tue, 9 Jan 2007 09:16:14 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
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.

ATOM RSS1 RSS2