com.rubecula.darwin.examples.travelingsalesman
Class Environment_TS

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.environment.Environment_
          extended by com.rubecula.darwin.domain.environment.Environment_Susceptible
              extended by com.rubecula.darwin.examples.travelingsalesman.Environment_TS
All Implemented Interfaces:
Susceptible, CacheSignature, Censusible, Environment, TakesTravelTime, Countable, Visualizable, java.lang.Cloneable, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString

public class Environment_TS
extends Environment_Susceptible
implements TakesTravelTime

Author:
Robin Hillyard

Field Summary
 
Fields inherited from class com.rubecula.darwin.domain.environment.Environment_
idealPopulation, LOG
 
Fields inherited from interface com.rubecula.darwin.domain.helper.Environment
IDEAL_POPULATION_DEFAULT, S_ID_UNIDENTIFIED
 
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
Environment_TS(Realm realm)
           
 
Method Summary
 Route formRoute()
           
 double getTravelTime()
           
 void init()
          Initialize this environment programatically (normally, initialization is done in the configuration).
protected  void logUpdate()
          This implementation forms the route from this Environment_TS and logs its details.
 boolean update(java.lang.String factorKey, java.lang.Object source)
          Find and set the eco factor to have the factor value, then, if successful, invoke Environment_.fireEnvironmentChanged().
protected  boolean updateFromSource(java.lang.Object source)
          This implementation updates the EcoFactor_Clients factor of the environment from the client map (which is what source actually is).
 
Methods inherited from class com.rubecula.darwin.domain.environment.Environment_Susceptible
updateFromSource
 
Methods inherited from class com.rubecula.darwin.domain.environment.Environment_
addFactor, addListener, censusMe, clone, environmentChanged, equals, factorKeys, fireEnvironmentChanged, getCensusibleChildren, getCount, getEcoFactorValue, getEcoSystem, getFactor, getIdealPopulation, getIdentifier, getIndividuals, getListeners, getRealm, getSignature, getSink, hashCode, setEcoSystem, setIdealPopulation, setListeners, setSink
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Environment_TS

public Environment_TS(Realm realm)
Parameters:
realm -
Method Detail

formRoute

public Route formRoute()
Returns:
the default route that goes to each client in turn or null if there are insufficient clients

getTravelTime

public double getTravelTime()
Specified by:
getTravelTime in interface TakesTravelTime
Returns:
the time that it takes to travel around this object.
See Also:
TakesTravelTime.getTravelTime(), formRoute()

init

public void init()
Description copied from interface: Environment
Initialize this environment programatically (normally, initialization is done in the configuration).

Specified by:
init in interface Environment
See Also:
Environment.init()

update

public boolean update(java.lang.String factorKey,
                      java.lang.Object source)
Description copied from class: Environment_
Find and set the eco factor to have the factor value, then, if successful, invoke Environment_.fireEnvironmentChanged().

Specified by:
update in interface Environment
Overrides:
update in class Environment_
Returns:
true if the environment was updated.
See Also:
Environment_.update(java.lang.String, java.lang.Object)

logUpdate

protected void logUpdate()
This implementation forms the route from this Environment_TS and logs its details.

Specified by:
logUpdate in class Environment_Susceptible
See Also:
Environment_Susceptible.logUpdate()

updateFromSource

protected boolean updateFromSource(java.lang.Object source)
This implementation updates the EcoFactor_Clients factor of the environment from the client map (which is what source actually is).

Specified by:
updateFromSource in class Environment_Susceptible
Returns:
true if this Environment was updated
See Also:
Environment_Susceptible.updateFromSource(java.lang.Object)


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