|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.server.qmanager.QManager
This class manages the queue of AutomatonEvents and QueuedAutomatons.
Field Summary | |
(package private) AutomatonMap |
aMap
Description of the Field |
private TreeSet |
automatonQueue
Description of the Field |
private LinkedList |
eventQueue
Description of the Field |
private HashMap |
timeToAutomatonMap
Description of the Field |
Constructor Summary | |
QManager(AutomatonMap aMap)
Constructor for the QManager object |
Method Summary | |
void |
addEventToQueue(AutomatonEvent event,
int x,
int y)
Adds an event to the event queue |
private void |
addUpdateToQueue(int x,
int y,
long msToExecution)
Adds an automaton to the automaton queue. |
private void |
checkAutomatonReturn(AutomatonReturn autRet,
int x,
int y)
Checks the return from an automaton update method, and possibly inserts the automaton and its neighbours into the queue. |
static void |
debug(String s)
Outputs to stdout. |
LinkedList |
getAutomatonEventQueue()
Gets the queue of AutomatonEvents |
TreeSet |
getAutomatonQueue()
Gets the queue of automatons |
long |
getCurrentTime()
Gets the current system time. |
static void |
log(String s)
Prints to the system log. |
void |
run()
Main processing method for the QManager object |
Methods inherited from class java.lang.Object |
|
Field Detail |
AutomatonMap aMap
private TreeSet automatonQueue
private HashMap timeToAutomatonMap
private LinkedList eventQueue
Constructor Detail |
public QManager(AutomatonMap aMap)
aMap
- A reference to the AutomatonMapMethod Detail |
public TreeSet getAutomatonQueue()
public LinkedList getAutomatonEventQueue()
public long getCurrentTime()
public void addEventToQueue(AutomatonEvent event, int x, int y)
event
- The event to be added.x
- The x coordinate of the position of the event.y
- The y coordinate of the position of the event.public void run()
run
in interface Runnable
private void addUpdateToQueue(int x, int y, long msToExecution)
x
- The x coordinate of the automaton.y
- The y coordinate of the automaton.msToExecution
- The time until the automaton should be updated.private void checkAutomatonReturn(AutomatonReturn autRet, int x, int y)
autRet
- The return object from the update method.x
- The x coordinate of the automaton that was updated.y
- The y coordinate of the automaton that was updated.public static void log(String s)
s
- The message to print.public static void debug(String s)
s
- The message to output.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |