Options
All
  • Public
  • Public/Protected
  • All
Menu

This mixin provides the constraint-based scheduling. Event is scheduled according to the set of constraints which can be applied to start date or end date.

Scheduling by constraints for an event can be disabled by setting its manuallyScheduled flag to true, which will delegate to previous behavior.

The constraint is represented with the DateInterval class, which indicates the "allowed" interval for the point being constrained.

Scheduling by constraints algorithm

Constraints for start date are accumulated in the startDateConstraintIntervals field of event itself and in the ConstrainedScheduleMixin.startDateConstraintIntervals field of its earlySchedule. Constraints for end date are accumulated in the endDateConstraintIntervals field of event itself and in the ConstrainedScheduleMixin.endDateConstraintIntervals field of its earlySchedule.

This mixin does not define where the constraints for the event comes from. The constraints are calculated in the event's schedule field calculation methods, (like ConstrainedScheduleMixin.calculateStartDateConstraintIntervals) which just return empty arrays. Some other mixins may override those methods and can generate actual constraints (the ConstrainedByDependenciesEventMixin is an example).

The "early" fields contains the constraints which are related to scheduling event in the as-soon-as-possible manner. The fields w/o "early" prefix contains the constraints which do not relate to the ASAP scheduling.

"Early" and "normal" constraints for every date are combined, then intersected, which gives "combined" constraining interval.

So at this point we have a "combined" constraining interval for start date and for end date.

Then, the interval for start date is shifted on the event duration to the right and this gives an additional constraint for the end date. The similar operation is done with the interval for the end date.

After intersection with those additional intervals we receive the final constraining interval for both dates. Since we are using the ASAP scheduling, we just pick the earliest possible date.

If any of intervals is empty then we consider it as scheduling conflict, and reject the transaction.

Hierarchy

Index

Properties

$project

The project instance, this entity belongs to.

calendar

The calendar of this entity.

Please use effectiveCalendar to get the calendar that is actually used by the entity. The calendar reflects only the value provided to this entity while effectiveCalendar returns the calendar that is really used (falls back to the project calendar in case the own calendar is not provided).

childEvents

childEvents: Set<HasChildrenMixin>

A set of references to child events

direction

direction: Direction

The scheduling direction of the event. The Forward direction corresponds to the as-soon-as-possible scheduling (ASAP), Backward - to as-late-as-possible (ALAP).

If not specified (which is the default), direction is inherited from the parent task (and from project for the top-level tasks). By default, the project model has forward scheduling mode.

dispatcher

dispatcher: SEDDispatcher

The dispatcher instance for this event. Dispatcher accumulates the information about user input and decide which formula to use for calculation of every related field (startDate, endDate and duration at this level).

Every field can be calculated with 2 type of formulas. The 1st one is called "proposed" and it is used when there is a user input for this field ("proposed" input), or, when user intention is to keep the previous value of the field. The 2nd type is called "pure" and it is used, when a value of the field should be calculated "purely" based on the values of other fields.

See CycleResolverGuide for more information.

duration

duration: Duration

The duration of the event. See also durationUnit.

durationUnit

durationUnit: TimeUnit

The duration unit of the event's duration. See also duration.

earlyEndDate

earlyEndDate: Date

The earliest possible date the event can finish. This value is calculated based on the event restrictions.

earlyStartDate

earlyStartDate: Date

The earliest possible date the event can start. This value is calculated based on the event restrictions.

effectiveCalendar

effectiveCalendar: BaseCalendarMixin

The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data calculation purposes.

effectiveVisualCalendar

effectiveVisualCalendar: BaseCalendarMixin

The effective calendar used by this entity (either its own calendar if provided or the project calendar) for data visualizing purposes.

endDate

endDate: Date

The end date of the event. Can also be provided as a string, parsable with DateHelper.parse()

endDateConstraintIntervals

endDateConstraintIntervals: DateInterval[]

Field to accumulate the "generic" constraints for end date (which are not related to ASAP scheduling). It is calculated with calculateEndDateConstraintIntervals.

getCalendar

getCalendar: () => BaseCalendarMixin

Gets the calendar.

Type declaration

getDirection

getDirection: () => Direction

Getter for direction field.

Type declaration

getEndDate

getEndDate: () => Date

Gets the event end date.

Type declaration

    • (): Date
    • Returns Date

getStartDate

getStartDate: () => Date

Gets the event start date

Type declaration

    • (): Date
    • Returns Date

graph

graph: Replica

A reference to the graph, this entity belongs to. Initially empty, and is populated when the entity instance is added to the replica (Replica.addEntity)

manuallyScheduled

manuallyScheduled: boolean

A boolean field, indicating whether this event should be scheduled automatically or its startDate and endDate are supposed to be defined manually.

parentEvent

parentEvent: HasChildrenMixin

A reference to the parent event

percentDone

percentDone: number

The percent done for this event.

project

The project instance, this entity belongs to.

setCalendar

setCalendar: (calendar: BaseCalendarMixin | ModelId) => Promise<CommitResult>

Sets the calendar. The method triggers schedule change propagation and returns a Promise:

// set calendar
model.setCalendar(calendar1).then(() => {
    // some code to run after schedule got updated
    ...
})

It also adds the calendar to the project calendar manager.

Type declaration

setDirection

setDirection: (value: Direction) => Promise<CommitResult>

Setter for direction field.

Type declaration

startDate

startDate: Date

The start date of the event. Can also be provided as a string, parsable with DateHelper.parse()

startDateConstraintIntervals

startDateConstraintIntervals: DateInterval[]

Field to accumulate the "generic" constraints for start date (which are not related to ASAP scheduling). It is calculated with calculateStartDateConstraintIntervals.

Accessors

$

  • get $(): {}
  • An object, which properties corresponds to the ChronoGraph Identifiers, created for every field.

    For example:

    class Author extends Entity.mix(Base) {
        @field()
        firstName       : string
        @field()
        lastName        : string
    }
    
    const author = Author.new()
    
    // identifier for the field `firstName`
    author.$.firstName
    
    const firstName = replica.read(author.$.firstName)

    Returns {}

$$

  • A graph identifier, that represents the whole entity.

    Returns EntityIdentifier

$entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

earlyPreSchedule

earlySchedule

Static $entity

  • An EntityMeta instance, representing the "meta" information about the entity class. It is shared among all instances of the class.

    Returns EntityMeta

Methods

calculateDuration

calculateDurationProposed

calculateDurationPure

calculateEffectiveCalendar

calculateEffectiveVisualCalendar

calculateEndDate

calculateEndDateProposed

calculateEndDatePure

calculateMaxChildrenEndDate

calculateMinChildrenStartDate

calculatePercentDone

calculateProjectedDuration

calculateProjectedXDateWithDuration

calculateStartDate

calculateStartDateProposed

calculateStartDatePure

commit

  • This is a convenience method, that just delegates to the ChronoGraph.commit method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a CommitZero constant will be returned.

    Parameters

    Returns CommitResult

commitAsync

  • This is a convenience method, that just delegates to the ChronoGraph.commitAsync method of this entity's graph.

    If there's no graph (entity has not been added to any replica) a resolved promise with CommitZero constant will be returned.

    Parameters

    Returns Promise<CommitResult>

enterGraph

  • enterGraph(replica: Replica): void
  • This method is called when entity is added to some replica.

    Parameters

    Returns void

getAssignmentById

  • getAssignmentById(id: ModelId): this["project"]["assignmentStore"]["modelInstanceT"]

getAssignmentStore

  • getAssignmentStore(): this["project"]["assignmentStore"]

getCalendarById

  • getCalendarById(id: ModelId): this["project"]["calendarManagerStore"]["modelInstanceT"]

getCalendarManagerStore

  • getCalendarManagerStore(): this["project"]["calendarManagerStore"]

getDependencyById

  • getDependencyById(id: ModelId): this["project"]["dependencyStore"]["modelInstanceT"]

getDependencyStore

  • getDependencyStore(): this["project"]["dependencyStore"]

getDuration

getEventById

  • getEventById(id: ModelId): this["project"]["eventStore"]["modelInstanceT"]

getEventStore

  • getEventStore(): this["project"]["eventStore"]

getGraph

getProject

  • getProject(): this["project"]

getResourceById

  • getResourceById(id: ModelId): this["project"]["resourceStore"]["modelInstanceT"]

getResourceStore

  • getResourceStore(): this["project"]["resourceStore"]

hasSubEvents

joinProject

  • joinProject(): void

leaveGraph

  • This method is called when entity is removed from the replica it's been added to.

    Parameters

    Returns void

leaveProject

  • leaveProject(isReplacing?: boolean): void

setDuration

setEndDate

  • setEndDate(date: Date, keepDuration?: boolean): Promise<CommitResult>

setProject

  • setProject(project: this["project"]): this["project"]

setStartDate

  • setStartDate(date: Date, keepDuration?: boolean): Promise<CommitResult>

shouldRollupChildEarlyEndDate

  • shouldRollupChildEarlyEndDate(child: ConstrainedEarlyEventMixin): CalculationIterator<boolean>

shouldRollupChildEarlyStartDate

  • shouldRollupChildEarlyStartDate(child: ConstrainedEarlyEventMixin): CalculationIterator<boolean>

shouldRollupChildEndDate

shouldRollupChildLateEndDate

  • shouldRollupChildLateEndDate(childEvent: ConstrainedEarlyEventMixin): CalculationIterator<boolean>

shouldRollupChildLateStartDate

  • shouldRollupChildLateStartDate(childEvent: ConstrainedEarlyEventMixin): CalculationIterator<boolean>

shouldRollupChildPercentDoneSummaryData

  • shouldRollupChildPercentDoneSummaryData(childEvent: HasPercentDoneMixin): ChronoIterator<boolean>

shouldRollupChildStartDate

skipNonWorkingTime

skipWorkingTime

subEventsIterable

userProvidedValue

Generated using TypeDoc