cz.cuni.amis.nb.pogamut.unreal.timeline.records
Class TLDatabase

Package class diagram package TLDatabase
java.lang.Object
  extended by cz.cuni.amis.nb.pogamut.unreal.timeline.records.TLDatabase
All Implemented Interfaces:
Serializable

public class TLDatabase
extends Object
implements Serializable

Structure containing all information about whole experiment and all agents inside.

Author:
Honza
See Also:
Serialized Form

Nested Class Summary
static class TLDatabase.Adapter
          Adapter for TLDatabase.TLDatabaseListener.
static interface TLDatabase.TLDatabaseListener
           
 
Constructor Summary
TLDatabase()
           
 
Method Summary
 void addDBListener(TLDatabase.TLDatabaseListener listener)
           
protected  void emitEntityLeft(TLEntity entity)
           
 TLEntity entityEntered(TLEntity entity)
          When entity enters, add it to list of watched entities and notify all listeners that we have new entity in database.
 long getCurrentTime()
           
 long getDeltaTime()
          Get time interval between start of recording and current time If recording hasn't started, return 0
 long getElapsedTime()
          Get time interval between start of recording and end of recording.
 long getEndTime()
           
 List<TLEntity> getEntities()
           
 Set<TLEntity> getEntities(long time)
          Get entities that are/were present at the specified time.
 cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getMap()
           
 long getStartTime()
           
 void printInfo(PrintStream stream)
          Print info about database and all entities into specified stream.
 void removeDBListener(TLDatabase.TLDatabaseListener listener)
           
 void setCurrentTime(long currentTime)
          Change current time and notify all listeners
 void setMap(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map)
           
 void startRecording()
          Start recording info from the environment.
 void stopRecording()
          Stop recording.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLDatabase

public TLDatabase()
Method Detail

getStartTime

public long getStartTime()

getCurrentTime

public long getCurrentTime()

getEndTime

public long getEndTime()

getElapsedTime

public long getElapsedTime()
Get time interval between start of recording and end of recording. If recording hasn't started, return 0

Returns:
time interval represented int db, in ms

getDeltaTime

public long getDeltaTime()
Get time interval between start of recording and current time If recording hasn't started, return 0

Returns:
time interval in ms

entityEntered

public TLEntity entityEntered(TLEntity entity)
When entity enters, add it to list of watched entities and notify all listeners that we have new entity in database. If db is not in recording state, throw new RuntimeException

Parameters:
entity -
Returns:

emitEntityLeft

protected void emitEntityLeft(TLEntity entity)

addDBListener

public void addDBListener(TLDatabase.TLDatabaseListener listener)

removeDBListener

public void removeDBListener(TLDatabase.TLDatabaseListener listener)

getEntities

public List<TLEntity> getEntities()

startRecording

public void startRecording()
Start recording info from the environment. This function only sets proper start, current and end time


stopRecording

public void stopRecording()
Stop recording. Update endTime and stop recording all entities.


setCurrentTime

public void setCurrentTime(long currentTime)
Change current time and notify all listeners

Parameters:
currentTime -

getEntities

public Set<TLEntity> getEntities(long time)
Get entities that are/were present at the specified time. Use start and last timestamps of entities to determine which ones.

Parameters:
newCurrent -

printInfo

public void printInfo(PrintStream stream)
Print info about database and all entities into specified stream.

Parameters:
stream - stream where to print info.

getMap

public cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap getMap()

setMap

public void setMap(cz.cuni.amis.pogamut.unreal.communication.worldview.map.IUnrealMap map)


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.