Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
rcpsp.proto
Go to the documentation of this file.
1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14// RCPSP: Resource-Constrained Project Scheduling Problem.
15//
16// The problem description is as follows:
17//
18// You have a set of resources. They all have a maximum capacity, and
19// can be renewable or not.
20//
21// You have a set of tasks. Each task has a list of successors, and a
22// list of recipes. Each recipe consists of a duration, and a list of
23// demands, one per resource.
24// The problem is always built with 2 sentinels. The first task is the source
25// with a set of successors. The last task is the sink, with no successors and a
26// zero duration.
27// All tasks are reachable from the source task. And the sink task is reachable
28// from all tasks. Furthermore, the graph has no cycles.
29//
30// The tasks dependencies form a DAG with a single source and a single end.
31// Both source and end tasks have a zero duration, and no resource consumption.
32//
33// In case the problem is of type RCPSP/Max. The data contains an additional
34// 3D array of delays per task. This structure contains the following
35// information for task i with recipe ri and successor j with recipe rj, then
36// start(i) + delay(i, ri, j, rj) <= start(j). This subsumes the normal
37// successor predecence of the non RCPSP/Max variation, i.e.:
38// start(i) + duration(i, mi) <= start(j).
39//
40// In the normal case, the objective is to minimize the makespan of the problem.
41//
42// In the resource investment problem, there is no makespan. It is
43// replaced by a strict deadline, and each task must finish before
44// this deadline. In that case, resources have a unit cost, and the
45// objective is to minimize the sum of resource cost.
46//
47// In the consumer/producer case, tasks have a zero duration, and demands can be
48// negative. The constraint states that at each time point, the sum of demands
49// happening before or during this time must be between the min and max
50// capacity. Note that in that case, both min and max capacity can be negative.
51// Furthermore, if 0 is not in [min_capacity, max_capacity], then a sufficient
52// set of events must happen at time 0 such that the sum of their demands must
53// fall inside the capacity interval.
54//
55// The supported file formats are:
56// - standard psplib (.sm and .mm):
57// http://www.om-db.wi.tum.de/psplib/data.html
58// - rcpsp problem in the patterson format (.rcp):
59// http://www.om-db.wi.tum.de/psplib/dataob.html
60// - rcpsp/max (.sch):
61// https://www.wiwi.tu-clausthal.de/de/abteilungen/produktion/forschung/
62// schwerpunkte/project-generator/rcpspmax/
63// https://www.wiwi.tu-clausthal.de/de/abteilungen/produktion/forschung/
64// schwerpunkte/project-generator/mrcpspmax/
65// - resource investment problem with max delay (.sch):
66// https://www.wiwi.tu-clausthal.de/de/abteilungen/produktion/forschung/
67// schwerpunkte/project-generator/ripmax/
68
69syntax = "proto3";
70
71option java_package = "com.google.ortools.scheduling.rcpsp";
72option java_multiple_files = true;
73option csharp_namespace = "Google.OrTools.Scheduling.Rcpsp";
74
75package operations_research.scheduling.rcpsp;
76
77message Resource {
78 // The max capacity of the cumulative.
79 int32 max_capacity = 1;
80
81 // This field is used only in the consumer/producer case. It states the
82 // minimum capacity that must be valid at each time point.
83 int32 min_capacity = 2;
84
85 // Indicates if the resource is renewable, that is if a task demands
86 // d from this resource, then the available capacity decreases by d at the
87 // start of the task and increases by d at the end of the task.
88 bool renewable = 3;
89
90 // If non zero, then each unit of capacity will incur a cost of unit_cost.
91 int32 unit_cost = 4;
92}
93
94message Recipe {
95 // The duration of the task when this recipe is selected.
96 int32 duration = 1;
97
98 // In the general case, demand must be >= 0. In the consumer/producer case,
99 // it can be < 0. Note that in this case, the tasks always have a duration
100 // of zero. Thus the effect of the demand (increase or decrease of the
101 // current usage) happens at the start of the task.
102 repeated int32 demands = 2;
103
104 // This parallel list indicates which resource index (in the main problem)
105 // the above demand corresponds to.
106 repeated int32 resources = 3;
107}
108
109message PerRecipeDelays {
110 repeated int32 min_delays = 1;
111}
112
113message PerSuccessorDelays {
114 repeated PerRecipeDelays recipe_delays = 1;
115}
116
117message Task {
118 // The indices of the successors tasks in the main problem.
119 repeated int32 successors = 1;
120
121 // The list of possible ways to execute the task.
122 repeated Recipe recipes = 2;
123
124 // If the current task has n successors and m recipes then this is
125 // an n x m matrix where each entry at line i is a vector with the
126 // same length as the number of recipes for the task successor[i]. If
127 // recipe m1 is chosen for the current task, and recipe m2 is chosen
128 // for its successor i, we have:
129 // start(current_task) + delay[i][m1][m2] <= start(successor_task).
130 repeated PerSuccessorDelays successor_delays = 3;
131}
132
133message RcpspProblem {
134 // Problem data.
135 repeated Resource resources = 1;
136 repeated Task tasks = 2;
137 // Problem type.
138 bool is_consumer_producer = 3;
139 bool is_resource_investment = 4;
140 bool is_rcpsp_max = 5;
141 // If set, it defines a strict date, and each task must finish before this.
142 int32 deadline = 6;
143 // Additional info stored in the source file.
144 // The horizon is a date where we are sure that all tasks can fit before it.
145 int32 horizon = 7;
146 // The release date is defined in the rcpsp base format, but is not used.
147 int32 release_date = 8;
148 // The tardiness cost is defined in the rcpsp base format, but is not used.
149 int32 tardiness_cost = 9;
150 // The mpm_time is defined in the rcpsp base format, but is not used.
151 // It is defined as the minimum makespan in case of interruptible tasks.
152 int32 mpm_time = 10;
153 // Data used by the problem generator.
154 int64 seed = 11;
155 string basedata = 12;
156 // The due date is defined in the rcpsp base format, but is not used.
157 int32 due_date = 13;
158 string name = 14;
159}
160
161message RcpspAssignment {
162 repeated int64 start_of_task = 1;
163 repeated int32 selected_recipe_of_task = 2;
164}