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

org.optaplanner.examples.batchscheduling.domain.RoutePath 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.examples.batchscheduling.app.BatchSchedulingApp;
import org.optaplanner.examples.common.domain.AbstractPersistable;

import com.thoughtworks.xstream.annotations.XStreamAlias;

@XStreamAlias("PipeRoutePath")
public class RoutePath extends AbstractPersistable {

    private Batch batch;
    private String path;
    private List segmentList;

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Batch getBatch() {
        return batch;
    }

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

    public List getSegmentList() {
        return segmentList;
    }

    public void setSegmentList(List segmentList) {
        this.segmentList = segmentList;
    }

    public static String[] getSegmentArray(String routePath) {
        String[] array1 = routePath.split(BatchSchedulingApp.ROUTE_PATH_SEPERATOR);

        String[] array2 = new String[array1.length - 1];

        for (int i = 0; i < array2.length; i++) {
            array2[i] = array1[i] + BatchSchedulingApp.ROUTE_PATH_SEPERATOR + array1[i + 1];
        }

        return array2;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy