|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.core.alg.AbstractAlgorithm
de.cau.cs.kieler.klay.force.model.AbstractForceModel
public abstract class AbstractForceModel
Superclass for force models.
Constructor Summary | |
---|---|
AbstractForceModel()
|
Method Summary | |
---|---|
static void |
avoidSamePosition(Random random,
FParticle u,
FParticle v)
Avoid having nodes on the same position by moving them a little. |
protected abstract KVector |
calcDisplacement(FParticle forcer,
FParticle forcee)
Calculate a displacement for the given particles. |
FGraph |
getGraph()
Return the graph for which the model was initialized. |
protected Random |
getRandom()
Return the random number generator for this model. |
protected void |
initialize(FGraph fgraph)
Initialize the force model with the given graph. |
protected void |
iterationDone()
Perform all necessary calculations after a full iteration. |
void |
layout(FGraph fgraph)
Perform layout on the given force graph. |
protected abstract boolean |
moreIterations(int count)
Determine whether more iterations need to be performed. |
Methods inherited from class de.cau.cs.kieler.core.alg.AbstractAlgorithm |
---|
getMonitor, reset, reset, setProgressMonitor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractForceModel()
Method Detail |
---|
protected void initialize(FGraph fgraph)
fgraph
- a force graphpublic final FGraph getGraph()
protected final Random getRandom()
public void layout(FGraph fgraph)
fgraph
- a force graphprotected void iterationDone()
protected abstract boolean moreIterations(int count)
count
- the current iterations count
true
if more iterations shall be doneprotected abstract KVector calcDisplacement(FParticle forcer, FParticle forcee)
forcer
- the particle that is causing the forceforcee
- the particle that is affected by the force
null
if no force is appliedpublic static void avoidSamePosition(Random random, FParticle u, FParticle v)
random
- the random number generatoru
- first nodev
- second node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |