JOpt.SDK
Interface IOptimization

All Known Implementing Classes:
Optimization

public interface IOptimization

IOptimization is the central interface and provides access to the optimization core. IOptimization provides several methods to set up the planning problem. Several setter methods allow to add nodes, resources, time and distance matrices and to finally start the optimization run. After the optimization has been started, the optimization run will be performed asynchronously and the optimization progress as well as the result will be returned via callback routines.


Method Summary
 void addDistanceMatrix(double[][] matrix)
           
 void addElement(INode node)
          add a node to the current optimization.
 void addElement(IResource resource)
          add a resource to the current optimization.
 void addElement(java.util.Properties property)
          add a property to the current optimization.
 void addTimeMatrix(double[][] matrix)
           
 IRoute checkAppointment(INode appointment)
          ckecks a desired appointment against the current optimization.
 double[][] getMatrix()
           
 IRoute insertAppointment(INode appointment)
          inserts a desired appointment into the current optimization.
 void onAsynchronousOptimizationResult(IOptimizationResult result)
          called after the optimization has been finished according to the defined terminating condition
 void onProgress(double progress)
          called each time when one percentage of the optimization is done
 void onProgress(double progress, double totaldistance, double costfunction)
          called each time when one percentage of the optimization is done
 void startAsynchronousOptimizationRun()
          starts a new optimization background process for all added elements, destroys all previous results
 

Method Detail

addElement

public void addElement(java.util.Properties property)
add a property to the current optimization.
JOptExitCondition.Type {JOptGenerationCount,JOptCostConvergency...}
JOptExitCondition.JOptGenerationCount [1,MAX_INT]
JOptWeight.TotalDistance [0.0,10.0]
JOptWeight.RouteDistance [0.0,10.0]
JOptWeight.ResourceActive [0.0,10.0]
JOptWeight.NodeType [0.0,10.0]
JOptWeight.TimeWindow [0.0,10.0]

Parameters:
property - a property to define the optimization's behaviour

addElement

public void addElement(IResource resource)
add a resource to the current optimization.

Parameters:
resource - a resource to perform the optimization's schedule

addElement

public void addElement(INode node)
add a node to the current optimization.

Parameters:
node - a node to be visited within the schedule

checkAppointment

public IRoute checkAppointment(INode appointment)
ckecks a desired appointment against the current optimization. If the appointment can be realized a route is returned. To insert the appointment use insertAppointment

Parameters:
appointment - a node with a time window
Returns:
a route containing the appointment or null if the appointment cannot be relaized within the exisisting optimization

insertAppointment

public IRoute insertAppointment(INode appointment)
inserts a desired appointment into the current optimization. If the appointment can be inserted a route is returned.

Parameters:
appointment - a node with a time window
Returns:
a route containing the appointment or null if the appointment cannot be inserted within the exisisting optimization

startAsynchronousOptimizationRun

public void startAsynchronousOptimizationRun()
                                      throws JOpt.Licence.LicenceNotFoundException
starts a new optimization background process for all added elements, destroys all previous results

Throws:
JOpt.Licence.LicenceNotFoundException

onAsynchronousOptimizationResult

public void onAsynchronousOptimizationResult(IOptimizationResult result)
called after the optimization has been finished according to the defined terminating condition

Parameters:
result - contains the optimization result or null if an error occured

onProgress

public void onProgress(double progress)
called each time when one percentage of the optimization is done

Parameters:
progress -

onProgress

public void onProgress(double progress,
                       double totaldistance,
                       double costfunction)
called each time when one percentage of the optimization is done

Parameters:
progress -
totaldistance - current distance of all routes
costfunction - abstract value of the current costfunction

addDistanceMatrix

public void addDistanceMatrix(double[][] matrix)
Parameters:
matrix - the distance matrix defining all distances between the nodes

addTimeMatrix

public void addTimeMatrix(double[][] matrix)
Parameters:
matrix - the time matrix defining all travelling times between the nodes

getMatrix

public double[][] getMatrix()
Returns:
the distance matrix