All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.optaplanner.examples.batchscheduling.domain.AllocationPath Maven / Gradle / Ivy

Go to download

OptaPlanner solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the examples which demonstrate how to use it in a normal Java application.

There is a newer version: 9.44.0.Final
Show newest version
package org.optaplanner.examples.batchscheduling.domain;

import java.util.List;

import org.optaplanner.core.api.domain.entity.PlanningEntity;
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
import org.optaplanner.core.api.domain.variable.PlanningVariable;
import org.optaplanner.examples.common.domain.AbstractPersistable;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@PlanningEntity
@XStreamAlias("PipeAllocationPath")
public class AllocationPath extends AbstractPersistable {

    private Batch batch;
    private List routePathList;

    // Planning variable, changes during planning, between score calculation
    private RoutePath routePath;

    public Batch getBatch() {
        return batch;
    }

    public void setBatch(Batch batch) {
        this.batch = batch;
    }

    public List getRoutePathList() {
        return routePathList;
    }

    public void setRoutePathList(List routePathList) {
        this.routePathList = routePathList;
    }

    @PlanningVariable(nullable = false, valueRangeProviderRefs = { "routePathList" })
    public RoutePath getRoutePath() {
        return routePath;
    }

    public void setRoutePath(RoutePath routePath) {
        this.routePath = routePath;
    }

    public String getLabel() {
        return "Label:: " + batch.getName();
    }

    // ************************************************************************
    // Ranges
    // ************************************************************************
    @ValueRangeProvider(id = "routePathList")
    public List getRoutePathListArray() {
        return routePathList;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy