com.rubecula.darwin.examples.travelingsalesman
Class EcoFactor_Clients
java.lang.Object
net.sf.tostring0.AToString
com.rubecula.darwin.domain.helper.Attribute_
com.rubecula.darwin.domain.environment.EcoFactor_
com.rubecula.darwin.examples.travelingsalesman.EcoFactor_TS
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
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. |
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 net.sf.tostring0.Identifiable |
getIdentifier |
FACTOR_CLIENTS
public static final java.lang.String FACTOR_CLIENTS
- clients
- See Also:
- Constant Field Values
EcoFactor_Clients
public EcoFactor_Clients()
- Construct an eco factor for the traveling salesman problem.
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.