1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use dpm_model::WorkItemId;
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Earliest/latest times and float for one activity, in elapsed hours after the origin.
pub struct ActivitySchedule {
/// Minimum feasible start relative to the projection origin.
pub earliest_start_hours: f64,
/// Earliest start plus activity duration.
pub earliest_finish_hours: f64,
/// Latest start that does not delay project completion.
pub latest_start_hours: f64,
/// Latest start plus activity duration.
pub latest_finish_hours: f64,
/// Delay available without postponing project completion.
pub total_float_hours: f64,
/// Delay available without moving any direct successor's earliest start or project completion.
pub free_float_hours: f64,
/// Whether total float is within numerical tolerance of zero.
pub critical: bool,
/// Calendar the task follows and how long its verification waits for the verifier, when the
/// plan has calendars.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub calendar: Option<ActivityCalendar>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
/// How calendars place one task in a remaining projection.
pub struct ActivityCalendar {
/// Calendar, executor kind and the rule that chose them.
#[serde(flatten)]
pub resolved: dpm_model::ResolvedCalendar,
/// Hours between the end of execution and verification at the earliest times, waiting for
/// the verifier's calendar.
pub review_wait_hours: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
/// Derived critical-path projection for the entire graph.
pub struct Schedule {
/// Earliest possible completion of every activity.
pub project_finish_hours: f64,
/// Activity projections indexed by work identity.
pub activities: BTreeMap<WorkItemId, ActivitySchedule>,
/// Work identities with zero total float.
pub critical_activities: Vec<WorkItemId>,
/// Every constraint between scheduled activities, with its slack at the earliest times.
#[serde(default)]
pub relations: BTreeMap<dpm_model::DependencyId, RelationSchedule>,
}
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
/// How tightly one constraint binds its successor in the projection.
pub struct RelationSchedule {
/// How far the successor's constrained event lies past the bound this constraint puts on it.
pub slack_hours: f64,
/// The constraint sets its successor's earliest start, or on calendars holds its finish: its
/// slack is within tolerance of zero.
pub driving: bool,
/// A driving constraint between two critical activities, so it lies on a critical path.
pub critical: bool,
}