stop condition for chunk wise job planning

This commit is contained in:
Fischlurch 2013-01-12 12:49:26 +01:00
parent a4411d00b1
commit 2b0e6d63c9
3 changed files with 18 additions and 5 deletions

View file

@ -88,10 +88,14 @@ namespace engine {
operator JobPlanningSequence()
{
TimeAnchor nextPlanningAnchor = refPoint_.buildNextAnchor();
TODO ("build the continuation job if necessary, wrap the sequence");
return JobPlanningSequence(
relativeFrameLocation(refPoint_), dispatcher_);
relativeFrameLocation(refPoint_),
nextPlanningAnchor.getStartFrame(),
dispatcher_);
}
};

View file

@ -286,6 +286,7 @@ namespace engine {
{
FrameLocator* locationGenerator_;
FrameCoord currentLocation_;
int64_t stopFrame_;
//////////////////////////////////////////TODO duplicated storage of a FrameCoord record
//////////////////////////////////////////TODO nextEvaluation_ is only needed to initialise the "current" sequence
@ -310,9 +311,10 @@ namespace engine {
typedef JobPlanning * pointer;
PlanningStepGenerator(FrameCoord startPoint, FrameLocator& locator)
PlanningStepGenerator(FrameCoord startPoint, int64_t stopPoint, FrameLocator& locator)
: locationGenerator_(&locator)
, currentLocation_(startPoint)
, stopFrame_(stopPoint)
{ }
// default copyable
@ -323,7 +325,7 @@ namespace engine {
friend bool
checkPoint (PlanningStepGenerator const& gen)
{
UNIMPLEMENTED ("determine planing chunk size"); /// return bool(seq.feed());
return gen.currentLocation_.absoluteFrameNumber < gen.stopFrame_;
}
friend JobPlanning&
@ -381,10 +383,10 @@ namespace engine {
{
public:
JobPlanningSequence(engine::FrameCoord startPoint, FrameLocator& locator)
JobPlanningSequence(engine::FrameCoord startPoint, int64_t stopPoint, FrameLocator& locator)
: ExpandedPlanningSequence(
JobPlanningChunkStartPoint(
PlanningStepGenerator(startPoint,locator))
PlanningStepGenerator(startPoint,stopPoint,locator))
>>= expandPrerequisites) // "flat map" (monad operation)
{ }

View file

@ -159,6 +159,13 @@ namespace engine {
}
/** @return the frame at which any job planning
* for this planning chunk will start */
int64_t getStartFrame() const
{
return anchorPoint_;
}
Offset
remainingRealTimeFor (FrameCoord plannedFrame)