OptaPlanner distribution 6.0.1-SNAPSHOT

org.optaplanner.examples.vehiclerouting.domain
Class VehicleRoutingSolution

java.lang.Object
  extended by org.optaplanner.examples.common.domain.AbstractPersistable
      extended by org.optaplanner.examples.vehiclerouting.domain.VehicleRoutingSolution
All Implemented Interfaces:
Serializable, Comparable<AbstractPersistable>, Solution<HardSoftScore>
Direct Known Subclasses:
TimeWindowedVehicleRoutingSolution

public class VehicleRoutingSolution
extends AbstractPersistable
implements Solution<HardSoftScore>

See Also:
Serialized Form

Field Summary
protected  List<Customer> customerList
           
protected  List<Depot> depotList
           
protected  List<Location> locationList
           
protected  String name
           
protected  HardSoftScore score
           
protected  List<Vehicle> vehicleList
           
 
Fields inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
id
 
Constructor Summary
VehicleRoutingSolution()
           
 
Method Summary
 boolean equals(Object o)
           
 List<Customer> getCustomerList()
           
 List<Depot> getDepotList()
           
 List<Location> getLocationList()
           
 String getName()
           
 Collection<? extends Object> getProblemFacts()
          Called by the DroolsScoreDirector when the Solution needs to be inserted into an empty KieSession.
 HardSoftScore getScore()
          Returns the Score of this Solution.
 List<Vehicle> getVehicleList()
           
 int hashCode()
           
 void setCustomerList(List<Customer> customerList)
           
 void setDepotList(List<Depot> depotList)
           
 void setLocationList(List<Location> locationList)
           
 void setName(String name)
           
 void setScore(HardSoftScore score)
          Called by the Solver when the Score of this Solution has been calculated.
 void setVehicleList(List<Vehicle> vehicleList)
           
 
Methods inherited from class org.optaplanner.examples.common.domain.AbstractPersistable
compareTo, getId, setId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name

locationList

protected List<Location> locationList

depotList

protected List<Depot> depotList

vehicleList

protected List<Vehicle> vehicleList

customerList

protected List<Customer> customerList

score

@XStreamConverter(value=XStreamScoreConverter.class,
                  types=HardSoftScoreDefinition.class)
protected HardSoftScore score
Constructor Detail

VehicleRoutingSolution

public VehicleRoutingSolution()
Method Detail

getName

public String getName()

setName

public void setName(String name)

getLocationList

public List<Location> getLocationList()

setLocationList

public void setLocationList(List<Location> locationList)

getDepotList

public List<Depot> getDepotList()

setDepotList

public void setDepotList(List<Depot> depotList)

getVehicleList

public List<Vehicle> getVehicleList()

setVehicleList

public void setVehicleList(List<Vehicle> vehicleList)

getCustomerList

public List<Customer> getCustomerList()

setCustomerList

public void setCustomerList(List<Customer> customerList)

getScore

public HardSoftScore getScore()
Description copied from interface: Solution
Returns the Score of this Solution.

Specified by:
getScore in interface Solution<HardSoftScore>
Returns:
null if the Solution is uninitialized or the last calculated Score is dirty the new Score has not yet been recalculated

setScore

public void setScore(HardSoftScore score)
Description copied from interface: Solution
Called by the Solver when the Score of this Solution has been calculated.

Specified by:
setScore in interface Solution<HardSoftScore>
Parameters:
score - null if the Solution has changed and the new Score has not yet been recalculated

getProblemFacts

public Collection<? extends Object> getProblemFacts()
Description copied from interface: Solution
Called by the DroolsScoreDirector when the Solution needs to be inserted into an empty KieSession. These facts can be used by the score rules. They don't change during planning (except through ProblemFactChange events).

Do not include the planning entities as problem facts: they are automatically inserted into the KieSession if and only if they are initialized. When they are initialized later, they are also automatically inserted.

Specified by:
getProblemFacts in interface Solution<HardSoftScore>
Returns:
never null (although an empty collection is allowed), all the facts of this solution except for the planning entities

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

OptaPlanner distribution 6.0.1-SNAPSHOT

Copyright © 2006-2014 JBoss by Red Hat. All Rights Reserved.