public class PropagateSegmentResults extends SegmentListResults
PropagateSegment
can optionally propagate multiple segments with an auto-sequence
with stopping conditions. When auto-sequences are run (possibly multiple times), there will
be a pattern where the PropagateSegments
propagator propagates,
then the SegmentPropagator
for the stopping conditions auto sequence will run, then the
original propagator if the stopping condition is configured to be tripped multiple times. The overall
SegmentResults
(get
) returned will be the PropagateSegmentResults
which is a
SegmentList
of all of the segments propagated
.Modifier | Constructor and Description |
---|---|
protected |
PropagateSegmentResults(PropagateSegmentResults existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
|
PropagateSegmentResults(SegmentPropagator propagator)
Initializes a new instance.
|
|
PropagateSegmentResults(SegmentPropagator propagator,
ITimeBasedState initialState)
Initializes a new instance.
|
|
PropagateSegmentResults(SegmentPropagator propagator,
PropagateSegmentResults results)
Initializes a new instance.
|
cropEphemerisForOverallTrajectory, generateOverallTrajectory, getDateMotionCollectionOfOverallTrajectory, getDateMotionCollectionOfOverallTrajectory, getElementDefinedIn, getFinalNestedSegmentResult, getFinalSegmentResult, getSegmentBoundaryTimes, getSegmentResults, isSegmentContainedInThisList, propagateToAssumingTimeBasedStates
addEphemerisPoint, getAdapter, getAdapters, getAdditionalSegmentResults, getCanceled, getConfiguration, getDateMotionCollection, getEntireComputedEphemeris, getEphemerisForOverallTrajectory, getFinalPropagatedState, getFirstPropagatedState, getIdentifiers, getInitialState, getIsThreadSafe, getMotionCollection, getMotionCollection, getOverrideSegmentListEphemeris, getParentResults, getPropagationDirection, getPropagator, getResultsOfSegment, getSegmentCompletelyOverriddenByOverlappingSegment, getSegmentIdentifier, getSegmentOverrideStartsIn, getStateForNextSegment, getStateForNextSegmentBehavior, getStopAllPropagation, getStopPropagationForCurrentSegmentList, getTimeIntervalOfEntireComputedEphemeris, getTimeIntervalOfEphemerisForOverallTrajectory, indexOfStateWithDateFromEntireComputedEphemeris, setCanceled, setConfiguration, setElementDefinedIn, setInitialState, setOverrideSegmentListEphemeris, setParentResults, setSegmentCompletelyOverriddenByOverlappingSegment, setSegmentOverrideStartsIn, setStopAllPropagation, setStopPropagationForCurrentSegmentList
public PropagateSegmentResults(@Nonnull SegmentPropagator propagator, PropagateSegmentResults results)
propagator
- The SegmentPropagator
that has created these results.results
- The results in which the stoppable results, condition stopped on, stopped on maximum duration and the base results are extracted.public PropagateSegmentResults(@Nonnull SegmentPropagator propagator)
propagator
- The SegmentPropagator
that has created these results.public PropagateSegmentResults(@Nonnull SegmentPropagator propagator, ITimeBasedState initialState)
propagator
- The SegmentPropagator
that has created these results.initialState
- The initial state
that the
propagator
was propagated from.protected PropagateSegmentResults(@Nonnull PropagateSegmentResults existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext)
for more information about how to implement this constructor
in a derived class.
existingInstance
- The existing instance to copy.context
- A CopyContext
that controls the depth of the copy.ArgumentNullException
- Thrown when existingInstance
or context
is null
.public Object clone(CopyContext context)
This method should be implemented to call a copy constructor on the class of the
object being cloned. The copy constructor should take the CopyContext
as a parameter
in addition to the existing instance to copy. The copy constructor should first call
CopyContext.addObjectMapping(T, T)
to identify the newly constructed instance
as a copy of the existing instance. It should then copy all fields, using
CopyContext.updateReference(T)
to copy any reference fields.
A typical implementation of ICloneWithContext
:
public static class MyClass implements ICloneWithContext {
public MyClass(MyClass existingInstance, CopyContext context) {
context.addObjectMapping(existingInstance, this);
someReference = context.updateReference(existingInstance.someReference);
}
@Override
public final Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
}
In general, all fields that are reference types should be copied with a call to
CopyContext.updateReference(T)
. There are a couple of exceptions:
If one of these exceptions applies, the CopyContext
should be given an opportunity
to update the reference before the reference is copied explicitly. Use
CopyContext.updateReference(T)
to update the reference. If CopyContext.updateReference(T)
returns
the original object, indicating that the context does not have a replacement registered,
then copy the object manually by invoking a Clone method, a copy constructor, or by manually
constructing a new instance and copying the values.
alwaysCopy = context.updateReference(existingInstance.alwaysCopy);
if (existingInstance.alwaysCopy != null && alwaysCopy == existingInstance.alwaysCopy) {
alwaysCopy = (AlwaysCopy) existingInstance.alwaysCopy.clone(context);
}
If you are implementing an evaluator (a class that implements IEvaluator
), the
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
method shares some responsibilities with the
copy context constructor. Code duplication can be avoided by doing the following:
CopyContext.updateReference(T)
. You should still call CopyContext.updateReference(T)
on any references to
non-evaluators.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as the last line in the constructor and pass it the
same CopyContext
passed to the constructor.
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
as normal. See the reference documentation for
IEvaluator.updateEvaluatorReferences(agi.foundation.infrastructure.CopyContext)
for more information on implementing that method.
public MyClass(MyClass existingInstance, CopyContext context) {
super(existingInstance, context);
someReference = context.updateReference(existingInstance.someReference);
evaluatorReference = existingInstance.evaluatorReference;
updateEvaluatorReferences(context);
}
@Override
public void updateEvaluatorReferences(CopyContext context) {
evaluatorReference = context.updateReference(evaluatorReference);
}
@Override
public Object clone(CopyContext context) {
return new MyClass(this, context);
}
private Object someReference;
private IEvaluator evaluatorReference;
clone
in interface ICloneWithContext
clone
in class SegmentListResults
context
- The context to use to perform the copy.public final StoppingCondition getConditionStoppedOn()
StoppingCondition
that stopped propagation.public final void setConditionStoppedOn(StoppingCondition value)
StoppingCondition
that stopped propagation.public final double getValueOfStoppingCondition()
StoppingCondition
that stopped propagation.public final List<StoppingCondition> getConditionsThatStoppedPropagation()
StoppingConditions
that stopped propagation in the order that
they occurred. This list will have more than 1 StoppingCondition
if
a StoppingCondition
that was satisfied was instructed to propagate its auto-segment
multiple times. See PropagateSegment.setStoppingConditionAutoSegment(agi.foundation.stoppingconditions.StoppingCondition, agi.foundation.segmentpropagation.SegmentDefinition, int)
for more
details. If you did not configure any auto-sequences for your
StoppingConditions
then there will be a single StoppingCondition
in this list.public final void addStoppingConditionBackwardsAdapters(SegmentDefinition segment, List<StateElementAdapter> backwardsAdapters)
StoppingCondition
will be run. So the
adapters
that go from the auto-segment back to the
native defined-ins of the parent NumericalPropagatorSegment
must be available for use.
This method allows you to add those adapters
to these results.segment
- The SegmentDefinition
associated with the backwardsAdapters
.backwardsAdapters
- The adapters
that can adapt
states
from the SegmentPropagator
that was the
auto-segment associated with the segment
.public final List<StateElementAdapter> backwardsAdaptersForStoppingConditionSegment(StoppingCondition condition)
List
of backwards adapters
associated with the condition
. These adapters
will allow
you to adapt the SegmentResults
(get
) of the auto-segment associated with the condition
back to the defined-ins of the initial propagation of the NumericalPropagatorSegment
that made these results.condition
- The StoppingCondition
whose backwards adapters
will be retrieved.adapters
that can adapt
states
from the SegmentPropagator
that was the
auto-segment associated with the condition
.public final boolean getStoppedOnMaximumDuration()
public final void setStoppedOnMaximumDuration(boolean value)
public final StoppablePropagatorResults getStoppablePropagatorResults()
StoppablePropagator
.public final void setStoppablePropagatorResults(StoppablePropagatorResults value)
StoppablePropagator
.public void regenerateEphemerisForOverallTrajectory()
EphemerisForOverallTrajectory
(get
) will
get rebuilt for this and all child segments. The states in this SegmentList
will be adapted to the final stored segment in this.regenerateEphemerisForOverallTrajectory
in class SegmentListResults