net.sf.myra.framework
Class Scheduler

java.lang.Object
  extended by net.sf.myra.framework.Scheduler
Direct Known Subclasses:
ParallelScheduler

public class Scheduler
extends java.lang.Object

This class represents the schedule of activities to evolve the colony of ants, in order to perform a search for solutions.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero

Field Summary
protected  DaemonAction action
          The daemon action.
protected  StopCondition condition
          The termination condition.
protected  Environment environment
          The running environment.
protected  ObjectiveFunction function
          The objective function used evaluate the ant trails (solutions).
protected  HeuristicInformation information
          The heuristic information.
protected  LocalSearch search
          The local search operator.
protected  PheromoneUpdater updater
          The pheromone update policy.
 
Constructor Summary
Scheduler(Colony colony, StopCondition condition, ObjectiveFunction function, PheromoneUpdater updater, HeuristicInformation information)
          Creates a new Scheduler instance.
 
Method Summary
protected  void createSolutions()
          Creates the ants' trails (solutions).
protected  void daemonActions()
          Executes the daemon actions.
 DaemonAction getDaemonAction()
          Returns the daemon action.
 LocalSearch getLocalSearch()
          Returns the local search operator.
 PheromoneUpdater getPheromoneUpdater()
          Returns the pheromone updater.
protected  void initialize()
          Initialization step.
 void run()
          Evolves the colony 'till the stop condition is reached.
 void setDaemonAction(DaemonAction action)
          Sets the daemon action.
 void setLocalSearch(LocalSearch search)
          Sets the local search operator.
protected  void updatePheromones()
          Updates the pheromone values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

condition

protected StopCondition condition
The termination condition.


environment

protected Environment environment
The running environment.


function

protected ObjectiveFunction function
The objective function used evaluate the ant trails (solutions).


search

protected LocalSearch search
The local search operator.


action

protected DaemonAction action
The daemon action.


updater

protected PheromoneUpdater updater
The pheromone update policy.


information

protected HeuristicInformation information
The heuristic information.

Constructor Detail

Scheduler

public Scheduler(Colony colony,
                 StopCondition condition,
                 ObjectiveFunction function,
                 PheromoneUpdater updater,
                 HeuristicInformation information)
Creates a new Scheduler instance.

Parameters:
colony - the colony of ants.
condition - the stop condition.
function - the objective function.
updater - the pheromone update policy.
Method Detail

run

public void run()
Evolves the colony 'till the stop condition is reached.


createSolutions

protected void createSolutions()
Creates the ants' trails (solutions).


updatePheromones

protected void updatePheromones()
Updates the pheromone values.


daemonActions

protected void daemonActions()
Executes the daemon actions.


initialize

protected void initialize()
Initialization step.


getLocalSearch

public LocalSearch getLocalSearch()
Returns the local search operator.

Returns:
the local search operator.

getPheromoneUpdater

public PheromoneUpdater getPheromoneUpdater()
Returns the pheromone updater.

Returns:
the pheromone updater.

setLocalSearch

public void setLocalSearch(LocalSearch search)
Sets the local search operator.

Parameters:
search - the local search operator to set.

getDaemonAction

public DaemonAction getDaemonAction()
Returns the daemon action.

Returns:
the daemon action.

setDaemonAction

public void setDaemonAction(DaemonAction action)
Sets the daemon action.

Parameters:
action - the daemon action to set.


Copyright © 2013. All Rights Reserved.