@ThreadSafe
public class Controller
extends java.lang.Object
MSim model controller.
This class contains algorithms that pertain to the whole MSim model, such
as analyze()
, as well as the updateThread
which synchronizes
Solver
rounds, Display
rendering, and model access tasks
scheduled with scheduleUpdateTask(java.lang.Runnable)
.
The update thread wakes up at least every UPDATE_MS
milliseconds, or whenever a task is pending, to do the following
notify()
one pending updateTasks
, if any (see scheduleUpdateTask(java.lang.Runnable)
, runUpdateTask(java.lang.Runnable)
, and sync(boolean, boolean, long)
).TrajectoryActor.update()
any active TrajectoryActor
s that
TrajectoryActor.needsUpdate()
WidgetInteractor#update
any active WidgetInteractor
s that
WidgetInteractor#needsUpdate
structureChanged
: re-analyze()
the model topology to
find all solve groups and setup the corresponding Solver
s, and imply
stateChanged
stateChanged
: updateAllCMTs()
updateAllSubtreeCoMs()
recomputeAllClosures()
Solver
s (which may
change the state again)UI
with a Display
: MSim.updateWidgetsRecursively()
and JOGLDisplay.render()
at least once
every minRenderMS
This class is designed to be thread safe. Synchronize on LOCK
before updateMetricsLock
.
Copyright (C) 2008 Marsette A. Vona, III
Modifier and Type | Class and Description |
---|---|
protected class |
Controller.UpdateThread
the async update thread, see class header doc
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<vona.time.TimeMetrics> |
allUpdateMetrics
all metrics involved in periodic update
|
protected vona.time.TimeMetrics |
analyzeStructureMetrics
metrics for indicated computation
|
protected boolean |
convergenceEnabled
Synthetic or locally cached
solveParameters . |
private static java.lang.String |
cvsid |
static boolean |
dbgStateChanged
whether to save most recent stack trace of indicated call for dbg
|
static boolean |
dbgStructureChanged
whether to save most recent stack trace of indicated call for dbg
|
static double |
DEF_MIN_RENDER_MS
default
minRenderMS |
protected boolean |
disableOnDiverge
Synthetic or locally cached
solveParameters . |
protected boolean |
disableOnStall
Synthetic or locally cached
solveParameters . |
protected boolean |
forceOneSolve
whether to force one solver update
|
protected java.lang.StackTraceElement[] |
lastStateChangedStackTrace
most recent stack trace of indicated call iff corresp dbg flag is set
|
protected java.lang.StackTraceElement[] |
lastStructureChangedStackTrace
most recent stack trace of indicated call iff corresp dbg flag is set
|
static java.lang.Object |
LOCK
global model state and structure synchronization object
|
protected double |
minRenderMS
min ms between
JOGLDisplay.render() s updateThread |
protected int |
numSublinkageSCCs
total number of sublinkage DAG SCCs
|
protected vona.time.TimeMetrics |
populateSolversMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
recomputeAllClosuresMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
renderMetrics
metrics for indicated computation
|
protected boolean |
singleStep
Synthetic or locally cached
solveParameters . |
protected vona.time.TimeMetrics |
sleepMetrics
metrics for indicated computation
|
protected java.util.Map<java.lang.String,java.lang.Object> |
solveParameters
The currently set
Solver parameters, see setSolveParameter(java.lang.String, java.lang.Object) . |
protected vona.time.TimeMetrics |
solveRoundMetrics
metrics for indicated computation
|
protected java.util.List<Solver> |
solvers
current set of
Solver s, see class header doc |
protected boolean |
stateChanged
numeric dirty flag, see class header doc
|
protected boolean |
structureChanged
topology dirty flag, see class header doc
|
protected vona.time.TimeMetrics |
switchRoundsMetrics
metrics for indicated computation
|
protected java.util.Set<TrajectoryActor> |
trajectoryActors
currently active
TrajectoryActor s |
protected java.util.Set<Joint> |
unassignedChainClosures
|
static int |
UPDATE_MS
sleep ms between wakeup checks in
updateThread |
protected vona.time.TimeMetrics |
updateActorsMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateAllCMTsMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateAllSubtreeCoMsMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateCycleMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateForwardMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateKinematicStateMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateMetrics
metrics for indicated computation
|
protected java.lang.Object |
updateMetricsLock
lock for metrics state
|
protected vona.time.TimeMetrics |
updateOpenChainsMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateSolverMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateSolversMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateStateMetrics
metrics for indicated computation
|
protected vona.time.TimeMetrics |
updateStructureMetrics
metrics for indicated computation
|
protected java.util.Queue<java.lang.Runnable> |
updateTasks
currently queued update tasks, see class header doc
|
protected vona.time.TimeMetrics |
updateTasksMetrics
metrics for indicated computation
|
protected Controller.UpdateThread |
updateThread
the update thread instance
|
protected java.lang.Object |
updateThreadLock
lock object for
updateThread |
protected vona.time.TimeMetrics |
updateWidgetsMetrics
metrics for indicated computation
|
protected java.util.Set<WidgetInteractor> |
widgetInteractors
currently active
WidgetInteractor s |
Constructor and Description |
---|
Controller() |
Modifier and Type | Method and Description |
---|---|
void |
addTrajectoryActor(TrajectoryActor actor)
add a
TrajectoryActor to trajectoryActors |
void |
addWidgetInteractor(WidgetInteractor interactor)
add a
WidgetInteractor to widgetInteractors |
void |
analyze()
(re)analyze the model topology, finding kinematic cycles and assigning
them to
Solver s. |
protected void |
analyzeStructure(Link link,
int depth)
Recursively DFS tree from link, tracing the kinematic cycles of
chain closure joints as they are encountered.
|
protected int |
assignSolveRounds(Linkage l,
int solveRound,
int thisSCC,
int nextSCC)
Assign
Linkage.solveRound and Linkage.sublinkageSCC by
DFS from l. |
boolean |
converged()
covers
converged(boolean) , ignoring disabled |
boolean |
converged(boolean ignoreDisabled)
check if
getNumUnconvergedSolvers(boolean) is zero |
boolean |
deactivateTrajectoryActor(TrajectoryActor actor)
Correctly deactivate a
TrajectoryActor even if it may be the
UI.manipulationDriver . |
boolean |
deactivateWidgetInteractor(WidgetInteractor interactor)
Correctly deactivate a
WidgetInteractor even if it may be the
UI.widgetInteractor . |
void |
dumpLastStateChangedStackTrace()
dumpLastStateChangedStackTrace(PrintStream) to System.out |
void |
dumpLastStateChangedStackTrace(java.io.PrintStream s)
Dump last
stateChanged stack trace, which are only collected
if dbgStateChanged . |
void |
dumpLastStructureChangedStackTrace()
dumpLastStructureChangedStackTrace(PrintStream) to System.out |
void |
dumpLastStructureChangedStackTrace(java.io.PrintStream s)
Dump last
structureChanged stack trace, which are only
collected if dbgStructureChanged . |
void |
dumpSolveCounts()
dumpSolveCounts(PrintStream) to System.out |
void |
dumpSolveCounts(java.io.PrintStream s)
Dump the total number of solvers, variables, and constraints, then
chain to
dumpSolveRounds(java.io.PrintStream) . |
void |
dumpSolveDetails()
dumpSolveDetails(PrintStream) to System.out |
void |
dumpSolveDetails(java.io.PrintStream s)
|
void |
dumpSolveNumericDetails()
dumpSolveNumericDetails(PrintStream) to System.out |
void |
dumpSolveNumericDetails(java.io.PrintStream s)
|
void |
dumpSolveParameters()
dumpSolveParameters(PrintStream) to System.out |
void |
dumpSolveParameters(java.io.PrintStream s)
Dump all current solve parameters.
|
void |
dumpSolveRounds()
dumpSolveRounds(PrintStream) to System.out |
void |
dumpSolveRounds(java.io.PrintStream s)
Dump the total number of solve rounds with at least one solver and their
partition.
|
void |
dumpSolveStats()
dumpSolveStats(PrintStream) to System.out |
void |
dumpSolveStats(java.io.PrintStream s)
|
void |
dumpSolveStructure()
dumpSolveStructure(PrintStream) to System.out |
void |
dumpSolveStructure(java.io.PrintStream s)
|
protected void |
dumpStackTrace(java.lang.StackTraceElement[] trace,
java.lang.String name,
java.io.PrintStream s)
common impl to dump stack traces
|
void |
dumpUpdateStats()
dumpUpdateStats(PrintStream) to System.out |
void |
dumpUpdateStats(java.io.PrintStream s)
dump a collection of stats on
updateThread processing |
protected boolean |
findSources(Linkage l,
java.util.List<Linkage> sources)
Find source sublinkages in solve round 0 by DFS from l.
|
void |
forceSolve()
Force one solver update.
|
double |
getMinRenderMS()
get the minimum render cycle time in milliseconds
|
int |
getNumSolveRounds()
get the total number of solve rounds containing at least one solver
|
int |
getNumSolvers()
get the total number of solvers
|
int |
getNumSublinkageSCCs()
|
int |
getNumUnconvergedSolvers()
covers
getNumUnconvergedSolvers(boolean) , ignoring disabled |
int |
getNumUnconvergedSolvers(boolean ignoreDisabled)
Get the number of unconverged
solvers . |
java.lang.Object |
getSolveParameter(java.lang.String name)
Get a previously set
Solver parameter. |
int[] |
getSolveRoundPartition()
covers
getSolveRoundPartition(int[]) , always conses |
int[] |
getSolveRoundPartition(int[] partition)
Get the number of solvers in each round with at least one solver.
|
int |
getTotalNumConstraints()
get the total number of constraints
|
int |
getTotalNumVariables()
get the total number of variables
|
boolean |
inUpdateThread()
check if called from within
updateThread |
protected boolean |
isLockedWithRespectTo(Joint treeJoint,
Joint closureJoint)
Check if treeJoint is considered locked with respect to
closureJoint.
|
boolean |
isUpdateThreadLive()
check if the update thread is alive
|
protected vona.time.TimeMetrics |
makeUpdateMetrics(java.lang.String name)
Make an update metrics object with the given name and add it to
allUpdateMetrics . |
protected void |
populateSolver(Solver solver,
Joint closureJoint)
Removes closureJoint from
unassignedChainClosures , adds
it to solver, and does same for all closure joints reachable from
closureJoint.support. |
int |
recomputeAllClosures()
Aliases corresponding recursive method in
MSim.getLinkage() . |
void |
removeTrajectoryActor(TrajectoryActor actor)
remove a
TrajectoryActor from trajectoryActors |
void |
removeWidgetInteractor(WidgetInteractor interactor)
remove a
WidgetInteractor from widgetInteractors |
void |
resetSolveStats()
Solver.resetStats() on all solvers |
void |
resetUpdateStats()
reset all
updateThread processing stats |
void |
runUpdateTask(java.lang.Runnable task)
Same as
scheduleUpdateTask(java.lang.Runnable) but synchronizes and on task
and wait() s iff not inUpdateThread() . |
void |
scheduleUpdateTask(java.lang.Runnable task)
Schedule a task to be run from within
updateThread . |
void |
setMinRenderMS(double ms)
set the minimum render cycle time in milliseconds
|
java.lang.Object |
setSolveParameter(java.lang.String name,
java.lang.Object value)
Set a parameter on all current and future
solvers . |
void |
startUpdateThread()
Start or re-start
updateThread . |
void |
stateChanged()
Set
stateChanged and save stack trace iff dbgStateChanged . |
void |
structureChanged()
Set
structureChanged and save stack trace iff dbgStructureChanged . |
boolean |
sync()
Covers
sync(boolean, boolean, long) , does not wait for
convergence. |
boolean |
sync(boolean waitForConvergence)
Covers
sync(boolean, boolean, long) , ignores disabled solvers
and waits indefinitely. |
boolean |
sync(boolean waitForConvergence,
boolean ignoreDisabled,
long timeoutMS)
Convenience method to ensure that at least one full update cycle
runs.
|
boolean |
sync(long timeoutMS)
Covers
sync(boolean, boolean, long) , ignores disabled solvers
and waits for convergence for the specified time. |
boolean |
toggleSolveParameter(java.lang.String name)
Use
getSolveParameter(java.lang.String) and setSolveParameter(java.lang.String, java.lang.Object) to toggle
the value of a boolean parameter. |
void |
updateAllCMTs()
Aliases corresponding recursive method in
MSim.getUltimateGroundLink() . |
void |
updateAllSubtreeCoMs()
Aliases corresponding recursive method in
MSim.getUltimateGroundLink() . |
private static final java.lang.String cvsid
public static final java.lang.Object LOCK
public static final int UPDATE_MS
updateThread
public static final double DEF_MIN_RENDER_MS
minRenderMS
protected boolean structureChanged
protected boolean stateChanged
protected final java.util.Queue<java.lang.Runnable> updateTasks
protected final java.util.Set<TrajectoryActor> trajectoryActors
TrajectoryActor
sprotected final java.util.Set<WidgetInteractor> widgetInteractors
WidgetInteractor
sprotected int numSublinkageSCCs
protected boolean convergenceEnabled
Synthetic or locally cached solveParameters
.
protected boolean singleStep
Synthetic or locally cached solveParameters
.
protected boolean disableOnDiverge
Synthetic or locally cached solveParameters
.
protected boolean disableOnStall
Synthetic or locally cached solveParameters
.
protected boolean forceOneSolve
protected final java.util.Map<java.lang.String,java.lang.Object> solveParameters
The currently set Solver
parameters, see setSolveParameter(java.lang.String, java.lang.Object)
.
This is used to determine the existing parameter settings when creating
new Solver
s and also to service getSolveParameter(java.lang.String)
queries.
protected final java.util.Set<Joint> unassignedChainClosures
protected double minRenderMS
JOGLDisplay.render()
s updateThread
public static final boolean dbgStateChanged
public static final boolean dbgStructureChanged
protected java.lang.StackTraceElement[] lastStateChangedStackTrace
protected java.lang.StackTraceElement[] lastStructureChangedStackTrace
protected final java.lang.Object updateMetricsLock
protected final java.util.List<vona.time.TimeMetrics> allUpdateMetrics
protected final vona.time.TimeMetrics updateCycleMetrics
protected final vona.time.TimeMetrics updateMetrics
protected final vona.time.TimeMetrics updateTasksMetrics
protected final vona.time.TimeMetrics updateActorsMetrics
protected final vona.time.TimeMetrics updateStructureMetrics
protected final vona.time.TimeMetrics analyzeStructureMetrics
protected final vona.time.TimeMetrics populateSolversMetrics
protected final vona.time.TimeMetrics updateStateMetrics
protected final vona.time.TimeMetrics updateOpenChainsMetrics
protected final vona.time.TimeMetrics updateAllCMTsMetrics
protected final vona.time.TimeMetrics updateAllSubtreeCoMsMetrics
protected final vona.time.TimeMetrics recomputeAllClosuresMetrics
protected final vona.time.TimeMetrics updateKinematicStateMetrics
protected final vona.time.TimeMetrics updateForwardMetrics
protected final vona.time.TimeMetrics updateWidgetsMetrics
protected final vona.time.TimeMetrics renderMetrics
protected final vona.time.TimeMetrics updateSolversMetrics
protected final vona.time.TimeMetrics updateSolverMetrics
protected final vona.time.TimeMetrics solveRoundMetrics
protected final vona.time.TimeMetrics switchRoundsMetrics
protected final vona.time.TimeMetrics sleepMetrics
protected final java.lang.Object updateThreadLock
updateThread
protected Controller.UpdateThread updateThread
protected vona.time.TimeMetrics makeUpdateMetrics(java.lang.String name)
Make an update metrics object with the given name and add it to allUpdateMetrics
.
public boolean inUpdateThread()
updateThread
public void scheduleUpdateTask(java.lang.Runnable task)
Schedule a task to be run from within updateThread
.
If called from inUpdateThread()
, the task is run directly.
MT safe.
task will be notify()
d after it is executed.
See class header doc for more info.
public void runUpdateTask(java.lang.Runnable task) throws java.lang.InterruptedException
Same as scheduleUpdateTask(java.lang.Runnable)
but synchronizes and on task
and wait()
s iff not inUpdateThread()
.
java.lang.InterruptedException
public boolean sync(boolean waitForConvergence, boolean ignoreDisabled, long timeoutMS) throws java.lang.InterruptedException
Convenience method to ensure that at least one full update cycle runs.
Specifically, inserts two update tasks into the queue and waits for them both to complete. This will ensure that any previously pending update tasks complete first, and then a full update cycle runs.
Does nothing if inUpdateThread()
.
waitForConvergence
- whether to continue to block until an update
cycle completes with all solvers
converged(boolean)
ignoreDisabled
- whether to ignore disabled solvers in the call to
converged(boolean)
timeoutMS
- the maximum time to block in milliseconds if waitForConvergence
, or 0 to block indefinitelyconverged(boolean)
java.lang.InterruptedException
public boolean sync(boolean waitForConvergence) throws java.lang.InterruptedException
Covers sync(boolean, boolean, long)
, ignores disabled solvers
and waits indefinitely.
java.lang.InterruptedException
public boolean sync(long timeoutMS) throws java.lang.InterruptedException
Covers sync(boolean, boolean, long)
, ignores disabled solvers
and waits for convergence for the specified time.
java.lang.InterruptedException
public boolean sync() throws java.lang.InterruptedException
Covers sync(boolean, boolean, long)
, does not wait for
convergence.
java.lang.InterruptedException
public void setMinRenderMS(double ms)
public double getMinRenderMS()
public void startUpdateThread()
Start or re-start updateThread
.
This is called automatically at app start, and normally that would be the only call. The update thread can die due to uncaught exceptions or errors, in which case restarting it may help with debugging.
java.lang.IllegalStateException
- if there is already a running update
threadpublic boolean isUpdateThreadLive()
public void stateChanged()
Set stateChanged
and save stack trace iff dbgStateChanged
.
public void structureChanged()
Set structureChanged
and save stack trace iff dbgStructureChanged
.
public void forceSolve()
Force one solver update.
protected void dumpStackTrace(java.lang.StackTraceElement[] trace, java.lang.String name, java.io.PrintStream s)
public void dumpLastStateChangedStackTrace(java.io.PrintStream s)
Dump last stateChanged
stack trace, which are only collected
if dbgStateChanged
.
public void dumpLastStateChangedStackTrace()
dumpLastStateChangedStackTrace(PrintStream)
to System.outpublic void dumpLastStructureChangedStackTrace(java.io.PrintStream s)
Dump last structureChanged
stack trace, which are only
collected if dbgStructureChanged
.
public void dumpLastStructureChangedStackTrace()
dumpLastStructureChangedStackTrace(PrintStream)
to System.outpublic java.lang.Object setSolveParameter(java.lang.String name, java.lang.Object value)
Set a parameter on all current and future solvers
.
Note: when future Solver
s are consed they will be configured in
the same order in which the parameters were set.
name
- identifies a public field of Solver
or one of its
superclasses, or a method setname or setNamevalue
- the new valuegetSolveParameter(java.lang.String)
)java.lang.IllegalStateException
- if no matching field or method was found,
or if there was a security or other problem in setting the parameterpublic java.lang.Object getSolveParameter(java.lang.String name)
Get a previously set Solver
parameter.
This will only find values that have been previously set with a call to
setSolveParameter(java.lang.String, java.lang.Object)
, plus disableOnStall
, disableOnDiverge
, convergenceEnabled
, and singleStep
.
name
- the parameter namepublic void dumpSolveParameters(java.io.PrintStream s)
Dump all current solve parameters.
This will only dump values that have been previously set with a call to
setSolveParameter(java.lang.String, java.lang.Object)
, plus disableOnStall
and disableOnDiverge
.
public void dumpSolveParameters()
dumpSolveParameters(PrintStream)
to System.outpublic boolean toggleSolveParameter(java.lang.String name)
Use getSolveParameter(java.lang.String)
and setSolveParameter(java.lang.String, java.lang.Object)
to toggle
the value of a boolean parameter.
If no existing value is found the parameter is assumed true.
public void addTrajectoryActor(TrajectoryActor actor)
TrajectoryActor
to trajectoryActors
public void removeTrajectoryActor(TrajectoryActor actor)
TrajectoryActor
from trajectoryActors
public void addWidgetInteractor(WidgetInteractor interactor)
WidgetInteractor
to widgetInteractors
public void removeWidgetInteractor(WidgetInteractor interactor)
WidgetInteractor
from widgetInteractors
public boolean deactivateTrajectoryActor(TrajectoryActor actor)
Correctly deactivate a TrajectoryActor
even if it may be the
UI.manipulationDriver
.
public boolean deactivateWidgetInteractor(WidgetInteractor interactor)
Correctly deactivate a WidgetInteractor
even if it may be the
UI.widgetInteractor
.
public void updateAllCMTs()
Aliases corresponding recursive method in MSim.getUltimateGroundLink()
.
public void updateAllSubtreeCoMs()
Aliases corresponding recursive method in MSim.getUltimateGroundLink()
.
public int recomputeAllClosures()
Aliases corresponding recursive method in MSim.getLinkage()
.
public void analyze()
(re)analyze the model topology, finding kinematic cycles and assigning
them to Solver
s.
Sets Joint.support
and Joint.branchLink
on all joints,
and sets solvers
to the new set of Solver
s.
Also sets LinkageNode.entityClass
.
Time complexity is linear in the sum of the total number of joints plus
the sizes of all Joint
supports, which in the worst case may be
O(n)^2 where n is the number of Joint
s.
Called automatically as necessary by updateThread
.
Joint.resetSolveFields()
on every joint considering theLinkage
containment tree as a directed graph where an edge from aLinkage.Disposition.DRIVING
child linkage points to its parent to aLinkage.Disposition.DRIVEN
child linkage points from its parent to/from aLinkage.Disposition.SIMULTANEOUS
child lkg is bidirectional assignLinkage.solveRound
by topological sort from source verts
DFS upon visiting a chain closure cj add cj tounassignedChainClosures
trace all treeJoint
s tj in cj.support, storing LCA to cj.branchLink, and appending unlocked cj to the support of tj
whileunassignedChainClosures
is not empty remove cj fromunassignedChainClosures
make a newSolver
s add cj to s.chainClosures for every closure joint ocj reachable from cj.support remove ocj fromunassignedChainClosures
add ocj to s.chainClosures add s tosolvers
init s
protected boolean findSources(Linkage l, java.util.List<Linkage> sources)
Find source sublinkages in solve round 0 by DFS from l.
A linkage is a source in solve round 0 iff it's (1) the top-level or any DRIVING sublinkage (2) with no DRIVING descendant reachable only via a SIMULTANEOUS chain.
Linkage.Disposition.DRIVING
itself or because it's Linkage.Disposition.SIMULTANEOUS
but driven by a descendantprotected int assignSolveRounds(Linkage l, int solveRound, int thisSCC, int nextSCC)
Assign Linkage.solveRound
and Linkage.sublinkageSCC
by
DFS from l.
The DFS is pruned whenever a child linkage is Linkage.Disposition.DRIVING
or whenever a linkage is Linkage.Disposition.DRIVEN
in its parent.
thisSCC
- the SCC identifier to assign to the SCC containing lnextSCC
- the next unused SCC identifierprotected void populateSolver(Solver solver, Joint closureJoint)
Removes closureJoint from unassignedChainClosures
, adds
it to solver, and does same for all closure joints reachable from
closureJoint.support.
Time complexity for all calls to this method, including from analyze()
and recursive calls, is bounded by the sum of the sizes of all
Joint.support
s.
protected void analyzeStructure(Link link, int depth)
Recursively DFS tree from link, tracing the kinematic cycles of chain closure joints as they are encountered.
Also sets LinkageNode.entityClass
.
Time complexity is proportional to the total number of joints plus the sum of the sizes of all kinematic cycles.
protected boolean isLockedWithRespectTo(Joint treeJoint, Joint closureJoint)
Check if treeJoint is considered locked with respect to closureJoint.
Nominally, this checks if either treeJoint is explicitly locked, has 0 DoF, or if treeJoint and closureJoint are not in the same SCC of the Linkage DAG. Crossing joints on driving sublinkages are an exception: they are handled as if they were a member of the superlinkage.
public void resetUpdateStats()
updateThread
processing statspublic void resetSolveStats()
Solver.resetStats()
on all solvers
public void dumpUpdateStats(java.io.PrintStream s)
updateThread
processingpublic void dumpUpdateStats()
dumpUpdateStats(PrintStream)
to System.outpublic int getNumSolvers()
public int getNumUnconvergedSolvers(boolean ignoreDisabled)
Get the number of unconverged solvers
.
ignoreDisabled
- whether to ignore solvers that have been marked
convergence disabled (this can happen e.g. because they were dected to be
diverging)public int getNumUnconvergedSolvers()
getNumUnconvergedSolvers(boolean)
, ignoring disabledpublic boolean converged(boolean ignoreDisabled)
getNumUnconvergedSolvers(boolean)
is zeropublic boolean converged()
converged(boolean)
, ignoring disabledpublic int getTotalNumVariables()
public int getTotalNumConstraints()
public int getNumSolveRounds()
public int getNumSublinkageSCCs()
public int[] getSolveRoundPartition(int[] partition)
Get the number of solvers in each round with at least one solver.
partition
- the partition in order from first to last round is
returned here (any intervening rounds with zero solvers are omitted); a
new array is consed if the passed array is null or too shortpublic int[] getSolveRoundPartition()
getSolveRoundPartition(int[])
, always consespublic void dumpSolveRounds(java.io.PrintStream s)
Dump the total number of solve rounds with at least one solver and their partition.
public void dumpSolveRounds()
dumpSolveRounds(PrintStream)
to System.outpublic void dumpSolveCounts(java.io.PrintStream s)
Dump the total number of solvers, variables, and constraints, then
chain to dumpSolveRounds(java.io.PrintStream)
.
public void dumpSolveCounts()
dumpSolveCounts(PrintStream)
to System.outpublic void dumpSolveStructure(java.io.PrintStream s)
public void dumpSolveStructure()
dumpSolveStructure(PrintStream)
to System.outpublic void dumpSolveStats(java.io.PrintStream s)
public void dumpSolveStats()
dumpSolveStats(PrintStream)
to System.outpublic void dumpSolveDetails(java.io.PrintStream s)
public void dumpSolveDetails()
dumpSolveDetails(PrintStream)
to System.outpublic void dumpSolveNumericDetails(java.io.PrintStream s)
public void dumpSolveNumericDetails()
dumpSolveNumericDetails(PrintStream)
to System.out