|
1 |
package rst.communicationpatterns;
|
|
2 |
|
|
3 |
option java_outer_classname = "ResourceAllocationType";
|
|
4 |
|
|
5 |
import "rst/timing/Interval.proto";
|
|
6 |
|
|
7 |
/**
|
|
8 |
*
|
|
9 |
* Data type to allocate resources for exclusive access with a certain priority
|
|
10 |
* and estimated duration. The type is meant to be exchanged between a
|
|
11 |
* scheduling component and its client applications based on the current state
|
|
12 |
* in the allocations life cycle. Target resources can be specified by one or
|
|
13 |
* more string identifiers. In order to allow a scheduling component to
|
|
14 |
* arbitrate between allocations, also an initiator (human or system), and a
|
|
15 |
* conflict resolution strategy have to be specified.
|
|
16 |
* @author Patrick Holthaus <patrick.holthaus@uni-bielefeld.de>
|
|
17 |
*/
|
|
18 |
message ResourceAllocation {
|
|
19 |
|
|
20 |
/**
|
|
21 |
* The state describes the life cycle of a single allocation attempt.
|
|
22 |
*/
|
|
23 |
enum State {
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Initial state: Resource requested for allocation in by a client
|
|
27 |
* component.
|
|
28 |
*/
|
|
29 |
REQUESTED = 10;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Resource allocation scheduled by the server component when being
|
|
33 |
* requested.
|
|
34 |
*/
|
|
35 |
SCHEDULED = 20;
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Resource allocation rejected by the server component when being
|
|
39 |
* requested, e.g. if the resource is busy.
|
|
40 |
*/
|
|
41 |
REJECTED = 30;
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Resource allocation cancelled while scheduled (before allocation)
|
|
45 |
* by either server or client.
|
|
46 |
*/
|
|
47 |
CANCELLED = 40;
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Resource is now allocated for the client at the server.
|
|
51 |
*/
|
|
52 |
ALLOCATED = 50;
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Resource allocation aborted abnormally (during allocation)
|
|
56 |
* by either server or client.
|
|
57 |
*/
|
|
58 |
ABORTED = 60;
|
|
59 |
|
|
60 |
/**
|
|
61 |
* Resource released normally (after allocation)
|
|
62 |
* by either server or client.
|
|
63 |
*/
|
|
64 |
RELEASED = 70;
|
|
65 |
|
|
66 |
}
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Priority ranking scheme for resource allocation when interacting with
|
|
70 |
* humans.
|
|
71 |
* Greater numeric values indicate higher priority.
|
|
72 |
*/
|
|
73 |
enum Priority {
|
|
74 |
|
|
75 |
/**
|
|
76 |
* No priority or unspecified; may be dismissed or cancelled at any
|
|
77 |
* time; dismiss if resource busy.
|
|
78 |
*/
|
|
79 |
NO = 0;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Interaction not affected or no user interaction; allowed to begin at
|
|
83 |
* later times.
|
|
84 |
*/
|
|
85 |
LOW = 1;
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Interaction affected non-critically; subsequent interactions only
|
|
89 |
* affected marginally; should start immediately.
|
|
90 |
*/
|
|
91 |
NORMAL = 2;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Interaction severely affected; has to be be completed to ensure
|
|
95 |
* intact communication and common conceptions; start immediately.
|
|
96 |
*/
|
|
97 |
HIGH = 3;
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Required for continued interaction or system operation; start
|
|
101 |
* immediately.
|
|
102 |
*/
|
|
103 |
URGENT = 4;
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Human or hardware safety threatened;
|
|
107 |
* Begin immediately; divert resources as necessary;
|
|
108 |
* overtime may be authorized.
|
|
109 |
*/
|
|
110 |
EMERGENCY = 5;
|
|
111 |
}
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Specifies the request's initiator. Automatically or periodically
|
|
115 |
* occurring allocations can generally be considered system-initiated while
|
|
116 |
* e.g. routines invoked from verbal interactions are initiated by a human.
|
|
117 |
*/
|
|
118 |
enum Initiator {
|
|
119 |
|
|
120 |
/**
|
|
121 |
* Resource is required by a system component.
|
|
122 |
*/
|
|
123 |
SYSTEM = 0;
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Resource is requested by a human interaction partner.
|
|
127 |
*/
|
|
128 |
HUMAN = 10;
|
|
129 |
}
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Specifies a request's conflict resolution policy, i.e., gives the
|
|
133 |
* scheduler a hint how it is allowed to modify the request in case of
|
|
134 |
* conflicts.
|
|
135 |
*/
|
|
136 |
enum Policy {
|
|
137 |
|
|
138 |
/**
|
|
139 |
* Only allocate as a a single, unmodified interval.
|
|
140 |
*/
|
|
141 |
PRESERVE = 0;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Allocate maximum amount of time available, shrink interval if needed.
|
|
145 |
*/
|
|
146 |
MAXIMUM = 10;
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Allocate the first time slot available, shrink interval if needed.
|
|
150 |
*/
|
|
151 |
FIRST = 20;
|
|
152 |
|
|
153 |
}
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Identifier of the current resource allocation attempt, i.e., not the
|
|
157 |
* resource itself.
|
|
158 |
*/
|
|
159 |
required string id = 10;
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Current state of resource allocation.
|
|
163 |
*/
|
|
164 |
required State state = 20;
|
|
165 |
|
|
166 |
/**
|
|
167 |
* Priority of resource allocation.
|
|
168 |
*/
|
|
169 |
required Priority priority = 30;
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Initiator of resource allocation.
|
|
173 |
*/
|
|
174 |
required Initiator initiator = 40;
|
|
175 |
|
|
176 |
/**
|
|
177 |
* Conflict resolution policy.
|
|
178 |
*/
|
|
179 |
required Policy policy = 50;
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Expected starting point and end of resource allocation.
|
|
183 |
*/
|
|
184 |
required .rst.timing.Interval slot = 60;
|
|
185 |
|
|
186 |
/**
|
|
187 |
* In case of conflicts, outter limits for shifting the interval can be
|
|
188 |
* specified using a constraint interval.
|
|
189 |
*/
|
|
190 |
optional .rst.timing.Interval constraints = 70;
|
|
191 |
|
|
192 |
/**
|
|
193 |
* Specifies the resources that are requested for allocation. The collection
|
|
194 |
* should at least contain one element. Elements can be specified in an
|
|
195 |
* arbitrary order. Given resources are treated in its entirety, i.e.,
|
|
196 |
* if one element causes a conflict, the whole allocation is affected.
|
|
197 |
*/
|
|
198 |
repeated string resource_ids = 80;
|
|
199 |
|
|
200 |
/**
|
|
201 |
* A description of or reason for the resource allocation request.
|
|
202 |
*/
|
|
203 |
optional string description = 90;
|
|
204 |
}
|
0 |
|
-
|