View Javadoc

1   package cz.cuni.amis.pogamut.multi.communication.messages;
2   
3   import cz.cuni.amis.pogamut.base.agent.IAgentId;
4   import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldChangeEvent;
5   
6   /**
7    * This message is used by a localWorldView to notify sharedWorldView, that a new batch has started and the LocalWorldView is
8    * waiting for the sharedWorldView to process all events from this batch.
9    * Since the batches are agent-dependent, the event contains information about both the time of the batch and the Agent that sent it.
10   * @author srlok
11   *
12   */
13  public class SharedBatchBeginEvent implements IWorldChangeEvent {
14  
15  	private long time;
16  	private IAgentId agentId;
17  	
18  	public SharedBatchBeginEvent(long time, IAgentId agentId)
19  	{
20  		this.time = time;
21  		this.agentId = agentId;
22  	}
23  	
24  	/**
25  	 * Returns ID of the agent from which comes the batch.
26  	 * @return
27  	 */
28  	public IAgentId getAgentId()
29  	{
30  		return agentId;
31  	}
32  	
33  	@Override
34  	public long getSimTime() {
35  		return time;
36  	}
37  	
38  	@Override
39  	public String toString() {
40  		return "SharedBatchBeginEvent[agentId=" + getAgentId() + ", time=" + getSimTime() + "]";
41  	}
42  	
43  
44  }