Свойство | Type | Description | |
---|---|---|---|
bestSolution | |||
bestValue | int | ||
count | long | ||
debug | bool | ||
name | String | ||
network | Cream.Network | ||
option | int | ||
solution | |||
startTime | long | ||
totalTimeout | long |
Méthode | Description | |
---|---|---|
ClearBest ( ) : void |
Clears the best solution this solver has been found.
|
|
FindAll ( ISolutionHandler handler ) : void |
Invokes the handler for each solution. This method is equivalent to {@link #FindAll(ISolutionHandler, long) FindFirst(handler, 0)}.
|
|
FindAll ( ISolutionHandler handler, long timeout ) : void |
Invokes the handler for each solution with the timeout. This method is implemented as follows: ClearBest(); Start(handler, timeout); Join();
|
|
FindBest ( ) : |
Finds the best solution. This method is equivalent to {@link #FindBest(long) FindBest(0)}.
|
|
FindBest ( long timeout ) : |
Finds the best solution with the timeout. This method is implemented as follows: ClearBest(); for (Start(timeout); WaitNext(); Resume()) { ; } Stop(); return getBestSolution();
|
|
FindFirst ( ) : |
Finds the first solution. This method is equivalent to {@link #FindFirst(long) FindFirst(0)}.
|
|
FindFirst ( long timeout ) : |
Finds the first solution with the timeout. This method is implemented as follows: ClearBest(); Start(timeout); WaitNext(); Stop(); return getBestSolution();
|
|
GetCount ( ) : long | ||
GetElapsedTime ( ) : long | ||
GetMonitor ( ) : Monitor |
Gets the monitor.
|
|
GetOption ( ) : int |
Returns the option value.
|
|
Join ( ) : void |
Waits until the solver ends the execution.
|
|
ResetIDCounter ( ) : void |
Resets the ID counter to be 0.
|
|
Resume ( ) : void |
Resumes the execution of the solver.
|
|
Run ( ) : void |
The body of the solver. This method is called from {@link Solver#Start} methods.
|
|
SetMonitor ( Monitor mon ) : void |
Sets the mon.
|
|
Start ( ) : void |
Starts the solver in a new thread, and immediately returns to the caller. The {@link #WaitNext()} and {@link #WaitNext(long timeout)} methods can be used to wait the next solution. When a solution is found, the solver suspends the execution until the {@link #Resume()} method is called. You can Stop the solver anytime by calling the {@link #Stop()} method.
|
|
Start ( ISolutionHandler handler ) : void |
Starts the solver in a new thread, and immediately returns to the caller. The handler is called for each solution and at the end of the solver execution. You can Stop the solver anytime by calling the {@link #Stop()} method.
|
|
Start ( ISolutionHandler handler, long timeout ) : void |
Starts the solver in a new thread with the timeout, and immediately returns to the caller. When the timeout milliseconds have been elapsed since the Start of the solver, it stops the execution. The handler is called for each solution and at the end of the solver execution. You can Stop the solver anytime by calling the {@link #Stop()} method.
|
|
Start ( long timeout ) : void |
Starts the solver in a new thread with the timeout, and immediately returns to the caller. When the timeout milliseconds have been elapsed since the Start of the solver, it stops the execution. The {@link #WaitNext()} and {@link #WaitNext(long timeout)} methods can be used to wait the next solution, or to detect the timeout. When a solution is found, the solver suspends the execution until the {@link #Resume()} method is called. You can Stop the solver anytime by calling the {@link #Stop()} method.
|
|
Stop ( ) : void |
Stops the execution of the solver.
|
|
ToString ( ) : String |
Returns the name of this solver.
|
|
WaitNext ( ) : bool |
Waits for the next solution, or the end of the solver execution. It returns true if the next solution is available, false if the solver ends the execution.
|
|
WaitNext ( long timeout ) : bool |
Waits for the next solution, or the end of the solver execution with the timeout. It returns true if the next solution is available within the timeout milliseconds, false if the solver ends the execution or the timeout milliseconds have been elapsed since the Start of this method.
|
Méthode | Description | |
---|---|---|
Fail ( ) : void | ||
IsBetter ( int value1, int value2 ) : bool | ||
IsOption ( int opt ) : bool | ||
Solver ( Cream.Network network ) : System |
Constructs a solver for the given network (for invocation by subclass constructors). This constructor is equivalent to Solver(network, Default, null).
|
|
Solver ( Cream.Network network, String name ) : System |
Constructs a solver for the given network and name (for invocation by subclass constructors). This constructor is equivalent to Solver(network, Default, name).
|
|
Solver ( Cream.Network network, int option ) : System |
Constructs a solver for the given network and option (for invocation by subclass constructors). This constructor is equivalent to Solver(network, option, null).
|
|
Solver ( Cream.Network network, int option, String name ) : System |
Constructs a solver for the given network, option, and name (for invocation by subclass constructors). When option is Default, None is used if the network has no objective variable, or else Minimize is used. Solvers and subclasses have their ID number starting from 0.
|
|
Success ( ) : void | ||
UpdateBest ( ) : bool |
public FindAll ( ISolutionHandler handler ) : void | ||
handler | ISolutionHandler | solution handler /// |
Résultat | void |
public FindAll ( ISolutionHandler handler, long timeout ) : void | ||
handler | ISolutionHandler | solution handler /// |
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat | void |
public FindBest ( long timeout ) : |
||
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat |
public FindFirst ( long timeout ) : |
||
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat |
protected IsBetter ( int value1, int value2 ) : bool | ||
value1 | int | |
value2 | int | |
Résultat | bool |
public SetMonitor ( Monitor mon ) : void | ||
mon | Monitor | monitor /// |
Résultat | void |
protected Solver ( Cream.Network network ) : System | ||
network | Cream.Network | the constraint network /// |
Résultat | System |
protected Solver ( Cream.Network network, String name ) : System | ||
network | Cream.Network | the constraint network /// |
name | String | the name of the solver /// |
Résultat | System |
protected Solver ( Cream.Network network, int option ) : System | ||
network | Cream.Network | the constraint network /// |
option | int | the option for search strategy /// |
Résultat | System |
protected Solver ( Cream.Network network, int option, String name ) : System | ||
network | Cream.Network | the constraint network /// |
option | int | the option for search strategy, or Default for default search strategy /// |
name | String | the name of the solver, or null for a default name /// |
Résultat | System |
public Start ( ISolutionHandler handler ) : void | ||
handler | ISolutionHandler | solution handler /// |
Résultat | void |
public Start ( ISolutionHandler handler, long timeout ) : void | ||
handler | ISolutionHandler | solution handler /// |
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat | void |
public Start ( long timeout ) : void | ||
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat | void |
public WaitNext ( long timeout ) : bool | ||
timeout | long | timeout in milliseconds (non-positive value means no timeout) /// |
Résultat | bool |