Class ViolationSummary

java.lang.Object
com.dna.jopt.member.unit.violation.ViolationSummary
All Implemented Interfaces:
IViolationSummary

public class ViolationSummary extends Object implements IViolationSummary
The Class ViolationSummary. An instance of this class will capture all violations of an ILogicEntityRoute. For example if the maximal allowed distance of a CapacityResource is violated the number of total violations (numViolations) and the number of distance violations (numViolationsRouteDistance) will be incremented. In addition, a normalized cost will be calculated. It is important to calculate this normalized cost to add up the costs of different violations to a total cost. The higher this total cost is the lower is the likeness that this route is the optimal route. The optimization process always tries to minimize this total cost.
Since:
17/02/2020
Version:
17/02/2020
Author:
DNA
  • Constructor Details

    • ViolationSummary

      public ViolationSummary()
      Instantiates a new violation summary.
  • Method Details

    • setNumViolationsRouteTime

      public void setNumViolationsRouteTime(int numViolationsRouteTime)
      Sets the number of violations (route time).
      Parameters:
      numViolationsRouteTime - the new number of violations (route time)
    • getNumViolationsRouteTime

      public int getNumViolationsRouteTime()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused when the Resource was working longer than the allowed maximal working time.
      Specified by:
      getNumViolationsRouteTime in interface IViolationSummary
      Returns:
      the int number of route time violations
      See Also:
    • setNumViolationsRouteDistance

      public void setNumViolationsRouteDistance(int numViolationsRouteDistance)
      Sets the number of violations (route distance).
      Parameters:
      numViolationsRouteDistance - the new number of violations (route distance)
    • getNumViolationsRouteDistance

      public int getNumViolationsRouteDistance()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by route distance, the default value is 0.
      Specified by:
      getNumViolationsRouteDistance in interface IViolationSummary
      Returns:
      the int number of route distance violations
    • setNumViolationsNodeType

      public void setNumViolationsNodeType(int numViolationsNodeType)
      Sets the number of violations (node type).
      Parameters:
      numViolationsNodeType - the new number of violations (node type)
    • getNumViolationsNodeType

      public int getNumViolationsNodeType()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by the Node type, the default value is 0.
      Specified by:
      getNumViolationsNodeType in interface IViolationSummary
      Returns:
      int number of violations because of the node type
    • setNumViolationsNodeTimewindow

      public void setNumViolationsNodeTimewindow(int numViolationsNodeTimewindow)
      Sets the number of violations (node timewindow).
      Parameters:
      numViolationsNodeTimewindow - the new number of violations (node timewindow)
    • getNumViolationsNodeTimewindow

      public int getNumViolationsNodeTimewindow()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by the Node time window, the default value is 0.
      Specified by:
      getNumViolationsNodeTimewindow in interface IViolationSummary
      Returns:
      int number of node time window violations
    • setNumViolationsRouteCapacity

      public void setNumViolationsRouteCapacity(int numViolationsRouteCapacity)
      Sets the number of violations (route capacity).
      Parameters:
      numViolationsRouteCapacity - the new number of violations (route capacity)
    • getNumViolationsRouteCapacity

      public int getNumViolationsRouteCapacity()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by route capacity, the default value is 0.
      Specified by:
      getNumViolationsRouteCapacity in interface IViolationSummary
      Returns:
      int number of route capacity violations
    • setNumViolations

      public void setNumViolations(int numViolations)
    • getNumViolations

      public int getNumViolations()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation , the default value is 0.
      Specified by:
      getNumViolations in interface IViolationSummary
      Returns:
      the numViolations
    • setNumViolationsNodeTimewindowEarly

      public void setNumViolationsNodeTimewindowEarly(int numViolationsNodeTimewindowEarly)
      Sets the number of violations node (timewindow early).
      Parameters:
      numViolationsNodeTimewindowEarly - the new number of violations node (timewindow early)
    • getNumViolationsNodeTimewindowEarly

      public int getNumViolationsNodeTimewindowEarly()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by being too early, the default value is 0.
      Specified by:
      getNumViolationsNodeTimewindowEarly in interface IViolationSummary
      Returns:
      int number of violations for being too early
    • setNumViolationsNodeTimewindowLate

      public void setNumViolationsNodeTimewindowLate(int numViolationsNodeTimewindowLate)
      Sets the number of violations node (timewindow late).
      Parameters:
      numViolationsNodeTimewindowLate - the new number of violations node (timewindow late)
    • getNumViolationsNodeTimewindowLate

      public int getNumViolationsNodeTimewindowLate()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by being too late, the default value is 0.
      Specified by:
      getNumViolationsNodeTimewindowLate in interface IViolationSummary
      Returns:
      int number of violations for being too late
    • setNumViolationsRelationships

      public void setNumViolationsRelationships(int numViolationsRelationships)
      Sets the number of violations (relationships).
      Parameters:
      numViolationsRelationships - the new number of violations (relationships)
    • getNumViolationsRelationships

      public int getNumViolationsRelationships()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by relationships , the default value is 0.
      Specified by:
      getNumViolationsRelationships in interface IViolationSummary
      Returns:
      int number of relationship violations
    • setNumViolationsDailyBreak

      public void setNumViolationsDailyBreak(int numViolationsDailyBreak)
      Sets the number of violations (daily break).
      Parameters:
      numViolationsDailyBreak - the new number of violations (daily break)
    • getNumViolationsDailyBreak

      public int getNumViolationsDailyBreak()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by breaks, the default value is 0.
      Specified by:
      getNumViolationsDailyBreak in interface IViolationSummary
      Returns:
      int number of break violations
    • setTotalLateTime

      public void setTotalLateTime(int totalLateTime)
      Sets the total late time.
      Parameters:
      totalLateTime - the new total late time
    • getTotalLateTime

      public int getTotalLateTime()
      Description copied from interface: IViolationSummary
      Gets total time that a Resurce was late in seconds.
      Specified by:
      getTotalLateTime in interface IViolationSummary
      Returns:
      the int total late time
    • setTotalEarlyTime

      public void setTotalEarlyTime(int totalEarlyTime)
      Sets the total early time.
      Parameters:
      totalEarlyTime - the new total early time
    • getTotalEarlyTime

      public int getTotalEarlyTime()
      Description copied from interface: IViolationSummary
      Gets total time that a Resource was early in seconds.
      Specified by:
      getTotalEarlyTime in interface IViolationSummary
      Returns:
      int total early time
    • setTotalLoadViolationAmount

      public void setTotalLoadViolationAmount(double totalLoadViolationAmount)
      Sets the total load violation amount.
      Parameters:
      totalLoadViolationAmount - the new total load violation amount
    • setTotalLoadViolationAmount

      public double setTotalLoadViolationAmount()
      Sets the total load violation amount.
      Returns:
      the total load violation amount
    • getCostEarly

      public double getCostEarly()
      Description copied from interface: IViolationSummary
      Gets the total cost added for being too early.
      Specified by:
      getCostEarly in interface IViolationSummary
      Returns:
      the double early cost
    • setCostEarly

      public void setCostEarly(double costEarly)
      Sets the cost (early).
      Parameters:
      costEarly - the new cost (early)
    • getCostLate

      public double getCostLate()
      Description copied from interface: IViolationSummary
      Gets the total cost added for being too late.
      Specified by:
      getCostLate in interface IViolationSummary
      Returns:
      the double late cost
    • setCostLate

      public void setCostLate(double costLate)
      Sets the cost (late).
      Parameters:
      costLate - the new cost (late)
    • getCostCapacity

      public double getCostCapacity()
      Description copied from interface: IViolationSummary
      Gets the total cost added by capacity violations in pickup and delivery optimizations, usually for not having loaded enough or for having loaded too much.
      Specified by:
      getCostCapacity in interface IViolationSummary
      Returns:
      the double cost for capacity violations
    • setCostCapacity

      public void setCostCapacity(double costCapacity)
      Sets the cost (capacity).
      Parameters:
      costCapacity - the new cost (capacity)
    • getCostCapacityOverload

      public double getCostCapacityOverload()
      Specified by:
      getCostCapacityOverload in interface IViolationSummary
    • setCostCapacityOverload

      public void setCostCapacityOverload(double costCapacityOverload)
    • getCostRelationship

      public double getCostRelationship()
      Description copied from interface: IViolationSummary
      Gets total cost added by relationship violations.
      Specified by:
      getCostRelationship in interface IViolationSummary
      Returns:
      the double cost for relationship violations
    • setCostRelationship

      public void setCostRelationship(double costRelationship)
      Sets the cost (relationship).
      Parameters:
      costRelationship - the new cost (relationship)
    • getCostRouteDistancePattern

      public double getCostRouteDistancePattern()
      Specified by:
      getCostRouteDistancePattern in interface IViolationSummary
    • setCostRouteDistancePattern

      public void setCostRouteDistancePattern(double costRouteDistancePattern)
      Sets the costRouteDistancePattern.
      Parameters:
      costRouteDistancePattern - the new cost route distance pattern
    • getCostDistance

      public double getCostDistance()
      Description copied from interface: IViolationSummary
      Gets the total cost added for the distance.
      Specified by:
      getCostDistance in interface IViolationSummary
      Returns:
      the double cost for distance
    • setCostDistance

      public void setCostDistance(double costDistance)
      Sets the cost (distance).
      Parameters:
      costDistance - the new cost (distance)
    • getCostMaxRouteDistance

      public double getCostMaxRouteDistance()
      Description copied from interface: IViolationSummary
      Gets the cost for being above max route distance
      Specified by:
      getCostMaxRouteDistance in interface IViolationSummary
      Returns:
      the costMaxRouteDistance
    • setCostMaxRouteDistance

      public void setCostMaxRouteDistance(double costMaxRouteDistance)
      Sets the cost (max route distance).
      Parameters:
      costMaxRouteDistance - the new cost (max route distance)
    • getCostMaxRouteTime

      public double getCostMaxRouteTime()
      Description copied from interface: IViolationSummary
      Gets the cost for being above max route time.
      Specified by:
      getCostMaxRouteTime in interface IViolationSummary
      Returns:
      the costMaxRouteTime
    • setCostMaxRouteTime

      public void setCostMaxRouteTime(double costMaxRouteTime)
      Sets the cost (max route time).
      Parameters:
      costMaxRouteTime - the new cost (max route time)
    • getCostNodeType

      public double getCostNodeType()
      Description copied from interface: IViolationSummary
      Gets cost caused by Node type.
      Specified by:
      getCostNodeType in interface IViolationSummary
      Returns:
      the double cost
    • setCostNodeType

      public void setCostNodeType(double costNodeType)
      Sets the cost (node type).
      Parameters:
      costNodeType - the new cost (node type)
    • getCostPreferredResource

      public double getCostPreferredResource()
      Description copied from interface: IViolationSummary
      Gets cost for preferred Resource constraints.
      Specified by:
      getCostPreferredResource in interface IViolationSummary
      Returns:
      the double cost
    • setCostPreferredResource

      public void setCostPreferredResource(double costPreferredResource)
      Sets the cost (preferred resource).
      Parameters:
      costPreferredResource - the new cost (preferred resource)
    • setCostRouteTime

      public void setCostRouteTime(double costRouteTime)
      Sets the cost route time.
      Parameters:
      costRouteTime - the new cost route time
    • getCostRouteTime

      public double getCostRouteTime()
      Gets the cost route time.
      Specified by:
      getCostRouteTime in interface IViolationSummary
      Returns:
      the cost route time
    • setResourceFixCost

      public void setResourceFixCost(double resourceFixCost)
      Sets the resource fix cost.
      Parameters:
      resourceFixCost - the new resource fix cost
    • getResourceFixCost

      public double getResourceFixCost()
      Gets the resource fix cost.
      Specified by:
      getResourceFixCost in interface IViolationSummary
      Returns:
      the resource fix cost
    • setNumViolationsColorNodeCapacity

      public void setNumViolationsColorNodeCapacity(int numViolationsColorNodeCapacity)
    • getNumViolationsColorNodeCapacity

      public int getNumViolationsColorNodeCapacity()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by INodeColor capacity.
      Specified by:
      getNumViolationsColorNodeCapacity in interface IViolationSummary
      Returns:
      the int number of nodeColorCapacity violations
    • setCostColorCapacityUsage

      public void setCostColorCapacityUsage(double costColorCapacityUsage)
    • getCostColorCapacityUsage

      public double getCostColorCapacityUsage()
      Description copied from interface: IViolationSummary
      Gets the cost for color capacity usage.
      Specified by:
      getCostColorCapacityUsage in interface IViolationSummary
      Returns:
      the double cost
    • setNumViolationsAfterEndAnchor

      public void setNumViolationsAfterEndAnchor(int numViolationsAfterEndAnchor)
    • getNumViolationsAfterEndAnchor

      public int getNumViolationsAfterEndAnchor()
      Description copied from interface: IViolationSummary
      Gets the number of IViolation that were caused by the Optimizer putting Nodes after the anchor Node, which might happen because the Route is very full.
      Specified by:
      getNumViolationsAfterEndAnchor in interface IViolationSummary
      Returns:
      the int number of violations after the anchor node
    • setCostAfterEndAnchor

      public void setCostAfterEndAnchor(double costAfterEndAnchor)
    • getCostAfterEndAnchor

      public double getCostAfterEndAnchor()
      Description copied from interface: IViolationSummary
      Gets the costs after the AnchorNode that were caused by the Optimizer putting Nodes after the anchor Node, which might happen because the Route is very full.
      Specified by:
      getCostAfterEndAnchor in interface IViolationSummary
      Returns:
      the double cost
    • getNumViolationsMissedServiceHours

      public int getNumViolationsMissedServiceHours()
      Specified by:
      getNumViolationsMissedServiceHours in interface IViolationSummary
    • setNumViolationsMissedServiceHours

      public void setNumViolationsMissedServiceHours(int numViolationsMissedServiceHours)
    • getCostMissedServiceHour

      public double getCostMissedServiceHour()
      Specified by:
      getCostMissedServiceHour in interface IViolationSummary
    • setCostMissedServiceHour

      public void setCostMissedServiceHour(double costMissedServiceHour)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDesc

      public static List<String> getDesc(List<IViolationSummary> vioSummaries, double minValue)
    • getDesc

      public static String getDesc(IViolationSummary summary, double minValue)
    • getCostTimeCompactness

      public double getCostTimeCompactness()
      Gets the cost time compactness.
      Specified by:
      getCostTimeCompactness in interface IViolationSummary
      Returns:
      the cost time compactness
    • setCostTimeCompactness

      public void setCostTimeCompactness(double costTimeCompactness)
      Sets the cost time compactness.
      Parameters:
      costTimeCompactness - the new cost time compactness
    • getCostGeoUnclustered

      public double getCostGeoUnclustered()
      Gets the cost geo unclustered.
      Specified by:
      getCostGeoUnclustered in interface IViolationSummary
      Returns:
      the cost geo unclustered
    • setCostGeoUnclustered

      public void setCostGeoUnclustered(double costGeoUnclustered)
      Sets the cost geo unclustered.
      Parameters:
      costGeoUnclustered - the new cost geo unclustered
    • getIMoveCost

      public double getIMoveCost()
      Gets the i move cost.
      Specified by:
      getIMoveCost in interface IViolationSummary
      Returns:
      the i move cost
    • setIMoveCost

      public void setIMoveCost(double costIMove)
      Sets the i move cost.
      Parameters:
      costIMove - the new i move cost
    • getStayOutFixCost

      public double getStayOutFixCost()
      Gets the stay out fix cost.
      Specified by:
      getStayOutFixCost in interface IViolationSummary
      Returns:
      the stay out fix cost
    • setStayOutFixCost

      public void setStayOutFixCost(double stayOutFixCost)
      Sets the stay out fix cost.
      Parameters:
      stayOutFixCost - the new stay out fix cost
    • getNodeFixCost

      public double getNodeFixCost()
      Gets the node fix cost.
      Specified by:
      getNodeFixCost in interface IViolationSummary
      Returns:
      the node fix cost
    • setNodeFixCost

      public void setNodeFixCost(double nodeFixCost)
      Sets the node fix cost.
      Parameters:
      nodeFixCost - the new node fix cost
    • getCostMisc

      public double getCostMisc()
      Gets the cost misc.
      Specified by:
      getCostMisc in interface IViolationSummary
      Returns:
      the cost misc
    • setCostMisc

      public void setCostMisc(double miscCost)
      Sets the cost misc.
      Parameters:
      miscCost - the new cost misc
    • getCostResourceOutOfWork

      public double getCostResourceOutOfWork()
      Gets the cost resource out of work.
      Specified by:
      getCostResourceOutOfWork in interface IViolationSummary
      Returns:
      the cost resource out of work
    • setCostResourceOutOfWork

      public void setCostResourceOutOfWork(double costResourceOutOfWork)
      Sets the cost resource out of work.
      Parameters:
      costResourceOutOfWork - the new cost resource out of work
    • getCostStayOvertime

      public double getCostStayOvertime()
      Gets the cost stay overtime.
      Specified by:
      getCostStayOvertime in interface IViolationSummary
      Returns:
      the cost stay overtime
    • setCostStayOvertime

      public void setCostStayOvertime(double costStayOvertime)
      Sets the cost stay overtime.
      Parameters:
      costStayOvertime - the new cost stay overtime
    • getCostInjectedRestriction

      public double getCostInjectedRestriction()
      Gets the cost injected restriction.
      Specified by:
      getCostInjectedRestriction in interface IViolationSummary
      Returns:
      the cost injected restriction
    • setCostInjectedRestriction

      public void setCostInjectedRestriction(double costInjectedRestriction)
      Sets the cost injected restriction.
      Parameters:
      costInjectedRestriction - the new cost injected restriction
    • getCostUnPreferredResource

      public double getCostUnPreferredResource()
      Gets the cost un preferred resource.
      Specified by:
      getCostUnPreferredResource in interface IViolationSummary
      Returns:
      the cost un preferred resource
    • setCostUnPreferredResource

      public void setCostUnPreferredResource(double costUnPreferredResource)
      Sets the cost un preferred resource.
      Parameters:
      costUnPreferredResource - the new cost un preferred resource
    • setCostBannedResource

      public void setCostBannedResource(double costBannedResource)
      Sets the cost banned resource.
      Parameters:
      costBannedResource - the new cost banned resource
    • getCostBannedResource

      public double getCostBannedResource()
      Gets the cost banned resource.
      Specified by:
      getCostBannedResource in interface IViolationSummary
      Returns:
      the cost banned resource
    • setCostMandatoryResource

      public void setCostMandatoryResource(double costMandatoryResource)
      Sets the cost mandatory resource.
      Parameters:
      costMandatoryResource - the new cost mandatory resource
    • getCostMandatoryResource

      public double getCostMandatoryResource()
      Gets the cost mandatory resource.
      Specified by:
      getCostMandatoryResource in interface IViolationSummary
      Returns:
      the cost mandatory resource
    • getTotalCost

      public static double getTotalCost(IViolationSummary summary)
    • getJoinedViolationSummary

      public static IViolationSummary getJoinedViolationSummary(List<IViolationSummary> summaries)
    • getDiffViolationSummary

      public static IViolationSummary getDiffViolationSummary(List<IViolationSummary> summaries)
    • joinViolationSummaries

      public static IViolationSummary joinViolationSummaries(IViolationSummary s1, IViolationSummary s2)
    • diffViolationSummaries

      public static IViolationSummary diffViolationSummaries(IViolationSummary s1, IViolationSummary s2)
    • connectViolationSummaries

      public static IViolationSummary connectViolationSummaries(IViolationSummary s1, IViolationSummary s2, boolean doAddUp)