Class MixedFlexLoad

java.lang.Object
com.dna.jopt.member.unit.pnd.load.AbstractLoad
com.dna.jopt.member.unit.pnd.load.flexload.MixedFlexLoad
All Implemented Interfaces:
IPNDItem, ILoad
Direct Known Subclasses:
RequestFlexLoad, SupplyFlexLoad, TimedSupplyFlexLoad

public class MixedFlexLoad extends AbstractLoad implements ILoad
The Class RestockLoad. Load as much items as possible from a restock-node. Usually, this makes sense in a delivery problem. Between different deliveries a resource can restock its load.

A restock node is like a supply node that can supply as much as necessary to completely fill up a truck.

Since:
Jul 22, 2020
Version:
Jul 22, 2020
Author:
jrich
  • Field Details

  • Constructor Details

    • MixedFlexLoad

      public MixedFlexLoad(String loadId)
      Instantiates a new MixedFlexLoad.
      Parameters:
      loadId - the load id
    • MixedFlexLoad

      public MixedFlexLoad(String loadId, int initialLoadValue, boolean isInitialRequest)
      Instantiates a new MixedFlexLoad.
      Parameters:
      loadId - the load id
      initialLoadValue - the initial load value
      isInitialRequest - the is initial request
    • MixedFlexLoad

      public MixedFlexLoad(String loadId, int initialLoadValue, boolean initialIsRequest, boolean isFuzzyVisit)
  • Method Details

    • merge

      public Optional<ILoad> merge(ILoad itemTwo)
      Description copied from interface: ILoad
      Merge two loads.
      Specified by:
      merge in interface ILoad
      Parameters:
      itemTwo - the item two
      Returns:
      the optional
    • visited

      public ILoad visited(ILoadCapacity cap, double acceptedLoadValue, long resourceArrivalTime)
      Description copied from interface: ILoad
      After a ILoadCapacity visited a load, the load gets the information, what load value was accepted by the capacity and when the capcity arrived at the load.
      Specified by:
      visited in interface ILoad
      Parameters:
      cap - the cap
      acceptedLoadValue - the accepted load value
      resourceArrivalTime - the resource arrival time
      Returns:
      the i load
    • getAdjustedLoadValue

      public double getAdjustedLoadValue(ILoadCapacity simpleLoadCapacity)
      Description copied from interface: ILoad
      Gets the adjusted load value. For Loads like UnloadAllLoad the load adjust to the loadValue a capacity is holding. Meaning, to unload all goods from a capacity, the load to be visited simply requests all goods from a capacity.
      Specified by:
      getAdjustedLoadValue in interface ILoad
      Parameters:
      simpleLoadCapacity - the simple load capacity
      Returns:
      the adjusted load value
    • toString

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

      @Default public String typeName()
      Description copied from interface: IPNDItem
      Gets the type name.
      Specified by:
      typeName in interface IPNDItem
      Returns:
      the type name
    • isFlexible

      public boolean isFlexible()
      Description copied from interface: ILoad
      Checks if is flexible. A flexible load, can adjust itself based on Optimization. Depending on the other customer nodes, flexible loads are able to compensate for potential over- or underloading of a ResourceDepot.
      Specified by:
      isFlexible in interface ILoad
      Overrides:
      isFlexible in class AbstractLoad
      Returns:
      true, if is flexible
      See Also:
    • copy

      public ILoad copy()
      Description copied from interface: ILoad
      Copies the load into a new Object.
      Specified by:
      copy in interface ILoad
      Returns:
      the copied ILoad