public class AlgorithmSchedule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected AlgorithmScheduleListener |
_eventProxy
proxy which forwarding messages to registered listeners
|
protected AlgorithmMarket |
_market
the market of algorithm runs
|
protected MessageCenter |
_messageCenter
message center for dispatching messages
|
protected Problem |
_problem
the problem to solve
|
protected Solver |
_solver
the solver running the schedule
|
protected Stopper |
_stopper
determines when to stop the trials
|
Constructor and Description |
---|
AlgorithmSchedule(Solver solver,
AlgorithmMarket market,
Stopper stopper)
Creates a new instance of Schedule.
|
Modifier and Type | Method and Description |
---|---|
void |
addAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
Add an algorithm schedule listener.
|
Trial |
evaluateTrialPoint(AlgorithmRun algorithmRun,
TrialPoint trialPoint)
Evaluate the specified trial point or return null if the run has been terminated.
|
void |
execute()
Execute the search schedule.
|
protected void |
execute(AlgorithmStrategy strategy)
Execute the specified strategy.
|
AlgorithmMarket |
getMarket()
Get the algorithm market.
|
Stopper |
getStopper()
Get the stopper.
|
void |
removeAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
Remove an algorithm schedule listener.
|
void |
reset()
Reset the algorithm run stack.
|
protected void |
score(Trial trial)
Score the trial.
|
void |
setProblem(Problem problem)
Assign a new problem.
|
void |
setStopper(Stopper stopper)
Assign a new stopper.
|
boolean |
shouldExecute()
Determine whether to continue executing the schedule.
|
protected MessageCenter _messageCenter
protected AlgorithmScheduleListener _eventProxy
protected volatile Stopper _stopper
protected Problem _problem
protected AlgorithmMarket _market
protected Solver _solver
public AlgorithmSchedule(Solver solver, AlgorithmMarket market, Stopper stopper)
solver
- The solvermarket
- The market providing runs.stopper
- The stopper which can terminate the schedule.public void reset()
public void addAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
aListener
- The listener to add.public void removeAlgorithmScheduleListener(AlgorithmScheduleListener aListener)
aListener
- The listener to remove.public AlgorithmMarket getMarket()
public void setProblem(Problem problem)
problem
- the new problempublic Stopper getStopper()
public void setStopper(Stopper stopper)
stopper
- the new stopperpublic boolean shouldExecute()
public void execute()
protected void execute(AlgorithmStrategy strategy)
strategy
- the strategy to execute.public Trial evaluateTrialPoint(AlgorithmRun algorithmRun, TrialPoint trialPoint)
trialPoint
- the trial point to evaluateRunTerminationException
- if the run has been terminatedprotected void score(Trial trial)
trial
- The trial to be scored.