Optsicom Framework¶
Optsicom framework is a Java library aimed at providing a managed environment where new algorithms can be developed, and where experiments involving these algorithms or previously developed ones can be run. The framework hides inner details about how experiments are run, allowing developers to focus on the stategies they need to tackle. Optsicom framework comprises the following modules: core, approx, exact, experiment and utils. In additions, an analysis module is also provided in order to permit programmatic analysis of results.
core module¶
This module contains the basic definitions needed to any optimization problem, which includes the definition of the problem, the definition of the instances for the problem, and the definition of the shape of the solutions.
The problem definition consists on defining the nature of the optimization: minimization or maximization, a solution comparator, on which the framework relies to determine the quality of the solutions submitted, and an instance repository manager that can be queried for instances.
The instance definitions consists basically on determining the data needed for the different types of instances that are considered within the problem.
Finally, defining the shape of the solutions consists on defining how solutions are represented.
These definitions are performed by implementing some interface. Sometimes, when it makes sense, there are abstract classes that provide default implementations for some methods. Users might prefer to subclass these abstract classes instead of implementing their parent interfaces to take advantage of this default implementations.
approx module¶
The approx module contains the basic elements to develop approximate algorithms. Most algorithms are written by using the Template Method, by subclassing the ApproxMethod class. When defining new algorithms there are three approaches:
- Defining the algorithm from scratch, by defining the high level procedure (in case of a metaheuristic) and the low level procedures (constructive method, improvement method, and so on)
- Reusing one of the high level procedures provided by the framework (like Scatter Search, Path Relinking, Multistart, among others), and provide exclusively the low level procedures.
- An intermediate approach consisting on copying a high level procedure in order to adapt it, and provide the low level procedures.
The approx module also provides the integration with commercial solvers like Evolver from Palisade Corporation, Solver from Frontline Systems, and Optquest from Opttek Systems.
exact module¶
The exact module is to exact algorithms what the approx module is for approximate algorithms. This module provides the necessary classes to define branch and bound algorithms, and models that can be used in conjunction with tools like CPLEX, Gurobi or GLPK.
experiment module¶
The experiment module contains the logic needed to run experiments to compare different algorithms. The definition of an experiment comprises the algorithms to compare, their actual parameters, the set of instances to use and the number of executions per instance. It is possible to specify a time limit.
The framework can store the time evolution of the algorithms, saving the information about each time that the best solution found so far was improved.
The information gathered in the experiments can be saved in a database or in DPEF (Durable and Plain Experiment Format).
utils module¶
The utils module contains utility classes that are used by the framework. Developres should take a moment to have a look at this module, as it provides several classes and methods that can save a lot of effort. These utilities include among others the following features:
- A manager for random number generators
- Utilities for collections:
- Sorting collections
- Finding maximum, minimum, calculating average
- Obtaining a collection that contains the integer numbers that belong to a given interval
- Utilities for arrays:
- Sorting arrays
- Finding maximum, minimum, calculating average