Examples of Capacity


Examples of com.amazonaws.services.dynamodbv2.model.Capacity

        if (to == null)
            return clone(from);
        if (from != null) {
            for (Map.Entry<String, Capacity> entryFrom : from.entrySet()) {
                final String key = entryFrom.getKey();
                final Capacity tocap = to.get(key);
                final Capacity fromcap = entryFrom.getValue();
                if (tocap == null) {
                    to.put(key, clone(fromcap));
                } else {
                    to.put(key, new Capacity().withCapacityUnits(
                        doubleOf(tocap) + doubleOf(fromcap)));
                }
            }
        }
        return to;
View Full Code Here

Examples of de.ailis.xadrian.data.Capacity

                    productQuantity);

                final List<?> resItems = element.elements("resource");
                final Product[] resources = new Product[resItems.size()];
                final Capacity[] storage = new Capacity[resItems.size() + 1];
                storage[0] = new Capacity(product.getWare(), Integer
                    .parseInt(productElement.attributeValue("storage")));
                int i = 0;
                for (final Object resItem : resItems)
                {
                    final Element resElement = (Element) resItem;
                    final Ware resWare = wareFactory.getWare(resElement
                        .attributeValue("ware"));
                    final int resQuantity = Integer.parseInt(resElement
                        .attributeValue("quantity"));
                    final int resStorage = Integer.parseInt(resElement
                        .attributeValue("storage"));
                    resources[i] = new Product(resWare, resQuantity);
                    storage[i + 1] = new Capacity(resWare, resStorage);
                    i++;
                }

                final List<?> manuItems = element.elements("manufacturer");
                final Sector[] manufacturers = new Sector[manuItems.size()];
View Full Code Here

Examples of jsprit.core.problem.Capacity

        if(route == null) throw new IllegalArgumentException("route is missing.");
        if(activity == null) throw new IllegalArgumentException("activity is missing.");
        if(activity instanceof Start) return getLoadAtBeginning(route);
        if(activity instanceof End) return getLoadAtEnd(route);
        verifyThatRouteContainsAct(activity, route);
        Capacity afterAct = stateManager.getActivityState(activity, InternalStates.LOAD,Capacity.class);
        if(afterAct != null && activity.getSize() != null){
            return Capacity.subtract(afterAct, activity.getSize());
        }
        else if(afterAct != null) return afterAct;
        else return null;
View Full Code Here

Examples of jsprit.core.problem.Capacity

     * @param route to get the capacity violation from
     * @return the capacity violation on this route, i.e. maxLoad - vehicleCapacity
     */
    public Capacity getCapacityViolation(VehicleRoute route){
        if(route == null) throw new IllegalArgumentException("route is missing.");
        Capacity maxLoad = getMaxLoad(route);
        return Capacity.max(Capacity.Builder.newInstance().build(),Capacity.subtract(maxLoad,route.getVehicle().getType().getCapacityDimensions()));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

     * dimension with dimIndex=0 and dimIndex=1 and dimIndex=1 is violated by 4 units then this method returns
     * [[dimIndex=0][dimValue=0][dimIndex=1][dimValue=4]]
     */
    public Capacity getCapacityViolationAtBeginning(VehicleRoute route){
        if(route == null) throw new IllegalArgumentException("route is missing.");
        Capacity atBeginning = getLoadAtBeginning(route);
        return Capacity.max(Capacity.Builder.newInstance().build(),Capacity.subtract(atBeginning,route.getVehicle().getType().getCapacityDimensions()));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

     * dimension with dimIndex=0 and dimIndex=1 and dimIndex=1 is violated by 4 units then this method returns
     * [[dimIndex=0][dimValue=0][dimIndex=1][dimValue=4]]
     */
    public Capacity getCapacityViolationAtEnd(VehicleRoute route){
        if(route == null) throw new IllegalArgumentException("route is missing.");
        Capacity atEnd = getLoadAtEnd(route);
        return Capacity.max(Capacity.Builder.newInstance().build(),Capacity.subtract(atEnd,route.getVehicle().getType().getCapacityDimensions()));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

     * [[dimIndex=0][dimValue=0][dimIndex=1][dimValue=4]]
     */
    public Capacity getCapacityViolationAfterActivity(TourActivity activity, VehicleRoute route){
        if(route == null) throw new IllegalArgumentException("route is missing.");
        if(activity == null) throw new IllegalArgumentException("activity is missing.");
        Capacity afterAct = getLoadRightAfterActivity(activity,route);
        return Capacity.max(Capacity.Builder.newInstance().build(),Capacity.subtract(afterAct,route.getVehicle().getType().getCapacityDimensions()));
    }
View Full Code Here

Examples of jsprit.core.problem.Capacity

  public void finish() {
        currentLoad = Capacity.Builder.newInstance().build();
  }
 
  void insertionStarts(VehicleRoute route) {
    Capacity loadAtDepot = Capacity.Builder.newInstance().build();
    Capacity loadAtEnd = Capacity.Builder.newInstance().build();
    for(Job j : route.getTourActivities().getJobs()){
      if(j instanceof Delivery){
        loadAtDepot = Capacity.addup(loadAtDepot, j.getSize());
      }
      else if(j instanceof Pickup || j instanceof Service){
View Full Code Here

Examples of jsprit.core.problem.Capacity

  }
 
  @Override
  public void informJobInserted(Job job2insert, VehicleRoute inRoute, double additionalCosts, double additionalTime) {
    if(job2insert instanceof Delivery){
      Capacity loadAtDepot = stateManager.getRouteState(inRoute, InternalStates.LOAD_AT_BEGINNING, Capacity.class);
            if(loadAtDepot == null) loadAtDepot = defaultValue;
      stateManager.putTypedInternalRouteState(inRoute, InternalStates.LOAD_AT_BEGINNING, Capacity.addup(loadAtDepot, job2insert.getSize()));
    }
    else if(job2insert instanceof Pickup || job2insert instanceof Service){
      Capacity loadAtEnd = stateManager.getRouteState(inRoute, InternalStates.LOAD_AT_END, Capacity.class);
            if(loadAtEnd == null) loadAtEnd = defaultValue;
      stateManager.putTypedInternalRouteState(inRoute, InternalStates.LOAD_AT_END, Capacity.addup(loadAtEnd, job2insert.getSize()));
    }
  }
View Full Code Here

Examples of jsprit.core.problem.Capacity

  public void setSolutionCompletenessRatio(double ratio){
    solution_completeness_ratio = ratio;
  }

  private double getDeltaAbsoluteFixCost(VehicleRoute route, Vehicle newVehicle, Job job) {
    Capacity load = Capacity.addup(getCurrentMaxLoadInRoute(route), job.getSize());
//    double load = getCurrentMaxLoadInRoute(route) + job.getCapacityDemand();
    double currentFix = 0.0;
    if(route.getVehicle() != null){
      if(!(route.getVehicle() instanceof NoVehicle)){
        currentFix += route.getVehicle().getType().getVehicleCostParams().fix;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.