|
Cream version 1.06 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.ac.kobe_u.cs.cream.Code
public class Code
Code is a list of conditions extracted from a
currently solved network. A code represents additional
conditions for the current solution. You can generate neighbor conditions,
and use the conditions to find neighbor solutions as follows.
Only useful for the problems containing Serialized
constraints
in the current implementation.
// Get a code from a solution Code code = solution.getCode(); // Get applicable operations for the code List<Operation> operations = code.operations(); // Choose an operation to generate a neighbor condition Operation op = operations.get(0); // Set the code to the network code.setTo(network); // Apply the operation to set a neighbor condition op.applyTo(network); // Find a neighbor solution which satisfies the neighbor condition Solution sol = solver.findBest();
Solution
,
Condition
,
Operation
,
Serialized
,
LocalSearch
Field Summary | |
---|---|
Condition[] |
conditions
|
Constructor Summary | |
---|---|
Code(Network network)
Constructs a code from the given network. |
Method Summary | |
---|---|
Object |
clone()
Returns a copy of this code. |
List<Operation> |
operations()
Returns possible operations applicable to the code. |
void |
setTo(Network network)
Sets the conditions of this code to the network. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Condition[] conditions
Constructor Detail |
---|
public Code(Network network)
network
- the constraint networkMethod Detail |
---|
public Object clone()
clone
in class Object
public void setTo(Network network)
network
- the networkpublic List<Operation> operations()
|
Cream version 1.06 Core API Specification |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |