com.rubecula.darwin.evolution
Class Evolution_Calendar

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.evolution.Evolver_
          extended by com.rubecula.darwin.evolution.Evolution_
              extended by com.rubecula.darwin.evolution.Evolution_Timed
                  extended by com.rubecula.darwin.evolution.Evolution_Calendar
All Implemented Interfaces:
com.rubecula.beanpot.Configurable, CalendarEvolution, Evolution, Evolver, Timed, Clocked, java.lang.Runnable, net.sf.tostring0.IToString

public final class Evolution_Calendar
extends Evolution_Timed
implements CalendarEvolution

Lifespan: permanent. Concrete implementation of Evolution which is based on Calendar i.e. where ticks using Evolution_.getClock() can be translated into a point in time.

Author:
Robin Hillyard

Field Summary
protected  double _factor
          The
 
Fields inherited from class com.rubecula.darwin.evolution.Evolution_Timed
rate
 
Fields inherited from class com.rubecula.darwin.evolution.Evolution_
_waitPeriod, MILLISECS_PER_SECOND
 
Fields inherited from class com.rubecula.darwin.evolution.Evolver_
LOG
 
Fields inherited from interface net.sf.tostring0.IToString
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE
 
Constructor Summary
Evolution_Calendar()
          TEST Secondary constructor for Evolution_Calendar - start is now, factor of 1000 (i.e.
Evolution_Calendar(boolean run)
          Secondary constructor for Evolution_Calendar - start is now, factor of 1000 (i.e.
Evolution_Calendar(java.util.Calendar start, boolean run)
          Secondary constructor for Evolution_Calendar with factor of 1000 (i.e.
Evolution_Calendar(java.util.Calendar start, double factor, boolean run)
           
Evolution_Calendar(java.util.Calendar start, TimeUnit factor, boolean run)
           
Evolution_Calendar(double factor, boolean run)
          Secondary constructor for Evolution_Calendar with start now (real time).
Evolution_Calendar(TimeUnit factor, boolean run)
          Secondary constructor for Evolution_Calendar with start now (real time).
 
Method Summary
 java.util.Calendar getTime()
          Get the current time of this evolution
 void scheduleEvent(java.util.Calendar when, java.lang.Runnable event)
           
 
Methods inherited from class com.rubecula.darwin.evolution.Evolution_Timed
getRate, getStart, getStartAdjustment, getTime, isRun, run, scheduleEvent, setRate
 
Methods inherited from class com.rubecula.darwin.evolution.Evolution_
cancelEvents, finalize, getClock, getElapsedTime, getEventExecutor, getEvolutionTask, getUi, isActive, isPaused, isWaitUntilComplete, next, pause, postConfigure, preConfigure, resume, setEvolutionTask, setUi, setWaitUntilComplete, shutdown, start, startAndWait, stop, stopExecutor, stoppable, waitUntilComplete
 
Methods inherited from class com.rubecula.darwin.evolution.Evolver_
addEvolvable, addEvolvable, addListener, addVisualizableListener, cleanup, getClockWatcher, getEvolvableKeys, getEvolvables, getListeners, getVisualizableListeners, init, putEvolvable, removeEvolvable, seedEvolvables, setClockWatcher, setEvolvables, setListeners, setVisualizableListeners, showTime, showTime
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.evolution.Evolver
addEvolvable, addEvolvable, addListener, cleanup, getClockWatcher, getEvolvableKeys, init, removeEvolvable, seedEvolvables, setClockWatcher
 

Field Detail

_factor

protected final double _factor
The

Constructor Detail

Evolution_Calendar

public Evolution_Calendar()
TEST Secondary constructor for Evolution_Calendar - start is now, factor of 1000 (i.e. one generation per second). Evolution starts immediately.


Evolution_Calendar

public Evolution_Calendar(boolean run)
Secondary constructor for Evolution_Calendar - start is now, factor of 1000 (i.e. one generation per second).

Parameters:
run - true if the evolution starts immediately

Evolution_Calendar

public Evolution_Calendar(java.util.Calendar start,
                          boolean run)
Secondary constructor for Evolution_Calendar with factor of 1000 (i.e. one tick per second).

Parameters:
start - the calendar value when this solar generator starts.
run - true if the evolution starts immediately

Evolution_Calendar

public Evolution_Calendar(java.util.Calendar start,
                          double factor,
                          boolean run)
Parameters:
start - the calendar value when this calendric evolution starts, for example, now or some date in the dim distant past (in which case start will probably need to be based on a historical, ie. non-Gregorian, calendar).
factor - the multiplier that turns milliseconds into evolutionary (or geological) time.
run - true if the evolution starts immediately

Evolution_Calendar

public Evolution_Calendar(java.util.Calendar start,
                          TimeUnit factor,
                          boolean run)
Parameters:
start - the calendar value when this calendric evolution starts, for example, now or some date in the dim distant past (in which case start will probably need to be based on a historical, ie. non-Gregorian, calendar).
factor - the multiplier that turns milliseconds into evolutionary (or geological) time.
run - true if the evolution starts immediately

Evolution_Calendar

public Evolution_Calendar(double factor,
                          boolean run)
Secondary constructor for Evolution_Calendar with start now (real time).

Parameters:
factor - the multiplier that turns ticks into evolutionary (or geological) time.
run - true if the evolution starts immediately

Evolution_Calendar

public Evolution_Calendar(TimeUnit factor,
                          boolean run)
Secondary constructor for Evolution_Calendar with start now (real time).

Parameters:
factor - the multiplier that turns ticks into evolutionary (or geological) time.
run - true if the evolution starts immediately
Method Detail

getTime

public java.util.Calendar getTime()
                           throws EvolutionException
Description copied from class: Evolution_Timed
Get the current time of this evolution

Specified by:
getTime in interface CalendarEvolution
Specified by:
getTime in interface Timed
Overrides:
getTime in class Evolution_Timed
Returns:
real time of this evolution
Throws:
EvolutionException
See Also:
Evolution_Timed.getTime()

scheduleEvent

public void scheduleEvent(java.util.Calendar when,
                          java.lang.Runnable event)
Specified by:
scheduleEvent in interface CalendarEvolution
Overrides:
scheduleEvent in class Evolution_Timed
See Also:
Evolution_Timed.scheduleEvent(java.util.Calendar, java.lang.Runnable)


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.