|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mil.af.afit.uvr.HSolution
A solution with vehicles servicing orders.
HOrder
,
HVehicle
,
HTour
Constructor Summary | |
HSolution(HSolution copyThis)
Create a solution that is a copy of copyThis. |
|
HSolution(HVehicle[] vehicles,
HOrder[] orders)
Makes a solution based on the passed arguments. |
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this solution |
java.lang.String |
costsToString()
Returns a string representation of the costs, including the names for the costs, if available. |
double[] |
getCosts()
Return the costs for this solution. |
HTour |
getDummyHTour()
Returns the dummy tour. |
HTour[] |
getHTours()
Returns the tours in the solution, excluding the dummy tour. |
HEvaluator |
getLastEvaluatorUsed()
Get the last evaluator that was used to validate this solution. |
int |
hashCode()
Returns a hashcode for the solution. |
void |
invalidate()
Should be called if the solution is changed. |
boolean |
isValid()
Returns whether or not the costs associated with the solution are valid. |
void |
setCosts(double[] costs)
Normally this should not be called, but if you have a reason to do it, this sets the costs and does not change the validity of the solution. |
java.lang.String |
toString()
|
void |
validate(HEvaluator evaluator)
Validate a solution based on a given evaluator. |
void |
validateTours()
Validates each tour. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HSolution(HVehicle[] vehicles, HOrder[] orders)
vehicles
- vehcustomers
- custHOrder
,
HVehicle
public HSolution(HSolution copyThis)
copyThis
- solution to copyMethod Detail |
public final boolean isValid()
HEvaluator
public final void validate(HEvaluator evaluator)
evaluator
- the evaluator to use for determing solution costsHEvaluator
public final void invalidate()
public final void validateTours()
HTour
public HTour[] getHTours()
HTour
public HTour getDummyHTour()
HTour
public double[] getCosts()
isValid()
to know if the costs are meaningful.HEvaluator
public void setCosts(double[] costs)
costs
- new costs for the solutionHEvaluator
public final HEvaluator getLastEvaluatorUsed()
HEvaluator
public java.lang.Object clone()
clone
in class java.lang.Object
public int hashCode()
int hash = 0;
double product = 1;
for( int i = 0; i < costs.length; i++ )
product *= ( costs[i] == 0 ? 1 : costs[i] );
hash = (int) ((product*1000)%Integer.MAX_VALUE);
return hash;
hashCode
in class java.lang.Object
public java.lang.String costsToString()
HEvaluator
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |