From a planning perspective, the easiest way to describe a timeline is to consider it as a mere collection of tokens (i.e., those tokens whose τ parameter assumes, as allowed value, the timeline). The values that the timelines assume over time, as well as the behavior assumed by the planner when new tokens are added to a timeline, depend not only on the tokens and on the modeled domain (i.e., the defined rules), but also on the nature of the timeline itself. Timelines, indeed, introduce further implicit (and higher level) constraints to the set of constraints C of a token network that, similarly to the partial-order planning case, can be explicated through the concept of threat. In the timeline-based case, however, threats might assume different semantics according to the nature of the involved timeline. Typical examples of timelines are multi-valued state-variables [84]. Renewable and consumable resources, like those commonly used in constraint-based scheduling [73], however, also fit within the above definition of timeline.
State-Variables. The state-variable is the most used type of timeline in this approach to planning. Predicates allowed by state-variables are defined by the user during the
(a) An example of state-variable (b) An example of reusable resource
(c) An example of consumable resource
Figure 2.10: Different kinds of timelines.
definition of the domain. The semantics of a state-variable is that for each time instant t∈ T the timeline can assume only one value. This corresponds to a temporally mutual exclusion rule between the tokens on the same state-variable. One option to manage this type of constraint is as follows: whenever there is an overlap of two or more tokens on the same state-variable, there is a threat which can be resolved by the solver either by imposing a temporal constraint, for ordering the tokens in time, or by imposing a constraint on their τ variables, indicating on which timeline the tokens should apply (roughly speaking, the tokens are separated on different state-variables). Intuitively, the temporal evolution of a state-variable (i.e., its value in time) is given directly by the tokens which are applied on it. Figure 2.10(a) represents an example of state-variable with its tokens (the τ variable is omitted for sake of space). Further examples of state- variables are the timelines used in the revised rover domain.
Consumable Resources. A consumable resource is a timeline characterized by a re- source level
L
: T → R, representing the amount of available resource at any given time. The resource level is increased or decreased by some activities of the modeled system. Additionally, consumable resources are characterized by a max ∈ R level, representing the physical upper limit of the resource as well as by a min ∈ R level, representing the physical lower limit of the resource. Finally, consumable resources require an initial amount init ∈ R representing the initial level of the resource. An example of consumable resource is a reservoir whose content is produced when some activity “fills” it (e.g., a tank refueling task) and consumed when some activity “emp- ties” it (e.g., driving a car uses gas). Consumable resources can be modeled through timelines whose tokens’ values allow only two predicates: a predicate Produce (a) torepresent a resource production of amount a, and a predicate Consume (a) to represent a resource consumption of amount a. Extracting, from the tokens, the temporal evolu- tion of a consumable resource (i.e., the resource level) is more complicated than in the state-variables’ case since it depends on how resource productions and consumptions are placed in time. Additionally, the planner may need to identify an ordering of the involved activities in order to avoid overproductions (resource level
L
cannot exceed the upper limit max) as well as overconsumption (resource levelL
cannot cannot be lower than the lower limit min). Clearly, overproductions and overconsumption can be managed as threats raised by consumable resources which, similarly to the state- variable threats, can be resolved either by imposing a temporal constraint for ordering the tokens in time, or by imposing a constraint on their τ variables indicating on which resource the token applies. Furthermore, constraints on the amounts of the productions and consumptions might also resolve the threat9. Figure 2.10(c) represents an example of consumable resource with its tokens and its profile.Reusable Resources. The last commonly used timeline type, quite popular in the scheduling literature, is the reusable resource. An example of reusable resource is the collection of available programmers of an IT company. Such programmers might be assigned to a given project for a specific amount of time after which the resource be- comes, again, available. Reusable resources can be modeled as consumable resources whose tokens consume an amount of resource at their start time and produce the same amount at their end time. Rather than a min and a max level, these timelines are char- acterized by a resource capacity
C
∈ R, representing the physical limit of the available resource. The initial amount of available resource is assumed to be equal to the resource capacity. The sole allowed predicate for reusable resources is U se (a) that represent an instantaneous consumption of resource of amount a at time s and an instantaneous production of resource of amount a at time e for each token assigned to the reusable resource. Let’s assume, for example, that there are two tokens, t0and t1, assigned tothe same reusable resource, such that the constraint t0.s < t1.e ∧ t1.s < t0.e holds (this
constraint simply forces their overlapping). The expected behavior of the resource is to have a resource usage of t0.a during t0’s duration when there isn’t overlapping with t1,
a resource usage of t0.a + t1.a when t0overlaps with t1, a resource usage of t1.a during
t1’s duration when there is no overlapping with t0and a resource usage of 0 elsewhere.
In other words, reusable resources’ temporal evolution is simply given by the concur- rent resource usages. Finally, resource overuses might be managed as threats raised by reusable resources which, similarly to state-variable threats and the consumable re- source ones, can be resolved either by imposing a temporal constraint for ordering the tokens in time or by imposing a constraint on their τ variables indicating on which re- source the token applies. Constraints on the amounts of the uses might also resolve the threat. Figure 2.10(b) represents an example of reusable resource with its tokens and its profile.
9It is worth to notice that threats on consumable resources might also be solved through the addition of
further productions and consumptions. This aspect makes the reasoning on consumable resources, in general, non-monotonic. A possible workaround, as proposed in [73], consists in closing the consumable resource, preventing the introduction of further tokens on the resource, before resolving threats on it.
It is worth to notice that resources have their own tokens which might be, in prin- ciple, unrelated by other state-variables’ tokens. This separation of concepts allows to easily model pure constraint-based scheduling problems without relying on the us- age of state-variables. Furthermore, this allows for greater flexibility in constraining tokens of a state-variable with the resources usages (e.g., we can model a resource usage which starts at some given time after an activity represented by a token on a state-variable). Finally, it is worth to highlight that the proposed formalism is open and can easily (in principle) introduce new kinds of timelines (e.g., batteries, whose overcharges represent wastes of energy, classical planning agents, etc.).