com.rubecula.darwin.examples.travelingsalesman
Class EcoFactor_Clients

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.helper.Attribute_
          extended by com.rubecula.darwin.domain.environment.EcoFactor_
              extended by com.rubecula.darwin.examples.travelingsalesman.EcoFactor_TS
                  extended by com.rubecula.darwin.examples.travelingsalesman.EcoFactor_Clients
All Implemented Interfaces:
Attribute, Censusible, EcoFactor, Individual, java.lang.Cloneable, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString

public class EcoFactor_Clients
extends EcoFactor_TS

This eco factor represents the clients that currently need to be visited and their two-dimensional locations. As new clients are added, or current clients are removed, the environment of course changes and selection favors the new fastest route.

Author:
Robin Hillyard

Field Summary
static java.lang.String FACTOR_CLIENTS
          clients
 
Fields inherited from class com.rubecula.darwin.domain.environment.EcoFactor_
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
EcoFactor_Clients()
          Construct an eco factor for the traveling salesman problem.
 
Method Summary
 java.lang.Object clone()
          Note that if an EcoFactor's value (or identifier) is mutable, i.e.
 Client getClient(int i)
          Get a specific client from the given order.
 java.util.Map<java.lang.Integer,Client> getClients()
           
 double getRadius()
           
 int getStops()
           
 void moveClient(int pos, Client client)
          Move all of the clients at positions pos or higher up by one.
 void setValue(java.lang.Object value)
          set the field Attribute_.value.
 
Methods inherited from class com.rubecula.darwin.examples.travelingsalesman.EcoFactor_TS
isNew, isVisible, update
 
Methods inherited from class com.rubecula.darwin.domain.environment.EcoFactor_
censusMe, getCensusibleChildren, getEnvironment, getVisualizable, setEnvironment, toString
 
Methods inherited from class com.rubecula.darwin.domain.helper.Attribute_
equals, getAttribute, getIdentifier, getValue, hashCode
 
Methods inherited from class net.sf.tostring0.AToString
toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Attribute
getAttribute, getValue
 
Methods inherited from interface net.sf.tostring0.Identifiable
getIdentifier
 

Field Detail

FACTOR_CLIENTS

public static final java.lang.String FACTOR_CLIENTS
clients

See Also:
Constant Field Values
Constructor Detail

EcoFactor_Clients

public EcoFactor_Clients()
Construct an eco factor for the traveling salesman problem.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: EcoFactor_
Note that if an EcoFactor's value (or identifier) is mutable, i.e. is not a primitive (or String) and is dynamically changeable, it probably needs deep-copying. Therefore sub-classes should probably override this method.

Overrides:
clone in class EcoFactor_
Throws:
java.lang.CloneNotSupportedException
See Also:
EcoFactor_.clone()

getClient

public Client getClient(int i)
Get a specific client from the given order.

Parameters:
i -
Returns:
the ith client.

getClients

public java.util.Map<java.lang.Integer,Client> getClients()
Returns:
the list of clients in no particular order.

getRadius

public double getRadius()
Returns:
the radius of the circle which best fits the clients.

getStops

public int getStops()
Returns:
the number of stops (clients) in this EcoFactor.

moveClient

public void moveClient(int pos,
                       Client client)
Move all of the clients at positions pos or higher up by one. Put the given client at position pos.

Parameters:
pos -
client -

setValue

public void setValue(java.lang.Object value)
Description copied from class: Attribute_
set the field Attribute_.value.

Specified by:
setValue in interface Attribute
Overrides:
setValue in class Attribute_
Parameters:
value - the new value for the attribute.
See Also:
Attribute_.setValue(java.lang.Object)


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