|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.Bayesia.positioning.algorithm.GeneticPositioning
The class GeneticPositioning is used to compute the positions of the vertices of
a com.Bayesia.positioning.structure.Graph.
The GeneticPositioning can be created specifying the size of the population used,
the individual mutation rate, the gene mutation rate and the selection rate.
It can be run in a thread or not. If not, the method start(int) must be used.
To listen to the progress of the positioning , a ProgressListener can be added to it.
Warning:
The start() method must be used in a thread so the algorithm could be stopped with stop().
Please see Graph
Please see ProgressListener
| Constructor Summary | |
GeneticPositioning(java.lang.String licenseKey,
Graph graph,
int populationSize,
double individualMutationRate,
double geneMutationRate,
double selectionRate)
Create a new GeneticPositioning on the given Graph with populationSize as the population size
and the different rates. |
|
| Method Summary | |
void |
addProgressListener(ProgressListener l)
Adds a listener to the list that's notified each time a change to the progress model occurs. |
void |
removeProgressListener(ProgressListener l)
Removes a listener from the list that's notified each time a change to the progress model occurs. |
void |
start()
Start the genetic positioning algorithm. |
void |
start(int maximumGenerationNumber)
Start the genetic positioning algorithm with the specified maximum number of generations. |
void |
stop()
Stop the running genetic positioning algorithm if this one was run in a thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GeneticPositioning(java.lang.String licenseKey,
Graph graph,
int populationSize,
double individualMutationRate,
double geneMutationRate,
double selectionRate)
GeneticPositioning on the given Graph with populationSize as the population size
and the different rates.
licenseKey - a valid license keygraph - the graph on which the positioning is donepopulationSize - the size of the population to use (>0)individualMutationRate - the mutation rate of each individual ([0, 1])geneMutationRate - the mutation rate of a gene ([0, 1])selectionRate - the selection rate ([0, 1])Graph| Method Detail |
public void addProgressListener(ProgressListener l)
l - the ProgressListenerpublic void removeProgressListener(ProgressListener l)
l - the ProgressListenerpublic void start()
Example :
final GeneticPositioning positioning = new GeneticPositioning(graph, 100, 0.2, 0.2, 0.2);
Thread t = new Thread() {
public void run() {
positioning.start();
}
};
t.setPriority(Thread.MIN_PRIORITY);
t.start();
To stop the algorithm use the stop method.
stop()public void start(int maximumGenerationNumber)
maximumGenerationNumber - the number of generations the algorithm will compute (>0).start(),
stop()public void stop()
start(),
start(int)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||