From c6a83108f19d5178e1c7d8c10c2855688a8c8db4 Mon Sep 17 00:00:00 2001 From: Patrick Holthaus Date: Wed, 27 Jul 2016 10:16:23 +0200 Subject: [PATCH] add resource allocation type --- .../communicationpatterns/ResourceAllocation.proto | 204 +++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 proto/sandbox/rst/communicationpatterns/ResourceAllocation.proto diff --git a/proto/sandbox/rst/communicationpatterns/ResourceAllocation.proto b/proto/sandbox/rst/communicationpatterns/ResourceAllocation.proto new file mode 100644 index 0000000..e467597 --- /dev/null +++ b/proto/sandbox/rst/communicationpatterns/ResourceAllocation.proto @@ -0,0 +1,204 @@ +package rst.communicationpatterns; + +option java_outer_classname = "ResourceAllocationType"; + +import "rst/timing/Interval.proto"; + +/** + * + * Data type to allocate resources for exclusive access with a certain priority + * and estimated duration. The type is meant to be exchanged between a + * scheduling component and its client applications based on the current state + * in the allocations life cycle. Target resources can be specified by one or + * more string identifiers. In order to allow a scheduling component to + * arbitrate between allocations, also an initiator (human or system), and a + * conflict resolution strategy have to be specified. + * @author Patrick Holthaus + */ +message ResourceAllocation { + + /** + * The state describes the life cycle of a single allocation attempt. + */ + enum State { + + /** + * Initial state: Resource requested for allocation in by a client + * component. + */ + REQUESTED = 10; + + /** + * Resource allocation scheduled by the server component when being + * requested. + */ + SCHEDULED = 20; + + /** + * Resource allocation rejected by the server component when being + * requested, e.g. if the resource is busy. + */ + REJECTED = 30; + + /** + * Resource allocation cancelled while scheduled (before allocation) + * by either server or client. + */ + CANCELLED = 40; + + /** + * Resource is now allocated for the client at the server. + */ + ALLOCATED = 50; + + /** + * Resource allocation aborted abnormally (during allocation) + * by either server or client. + */ + ABORTED = 60; + + /** + * Resource released normally (after allocation) + * by either server or client. + */ + RELEASED = 70; + + } + + /** + * Priority ranking scheme for resource allocation when interacting with + * humans. + * Greater numeric values indicate higher priority. + */ + enum Priority { + + /** + * No priority or unspecified; may be dismissed or cancelled at any + * time; dismiss if resource busy. + */ + NO = 0; + + /** + * Interaction not affected or no user interaction; allowed to begin at + * later times. + */ + LOW = 1; + + /** + * Interaction affected non-critically; subsequent interactions only + * affected marginally; should start immediately. + */ + NORMAL = 2; + + /** + * Interaction severely affected; has to be be completed to ensure + * intact communication and common conceptions; start immediately. + */ + HIGH = 3; + + /** + * Required for continued interaction or system operation; start + * immediately. + */ + URGENT = 4; + + /** + * Human or hardware safety threatened; + * Begin immediately; divert resources as necessary; + * overtime may be authorized. + */ + EMERGENCY = 5; + } + + /** + * Specifies the request's initiator. Automatically or periodically + * occurring allocations can generally be considered system-initiated while + * e.g. routines invoked from verbal interactions are initiated by a human. + */ + enum Initiator { + + /** + * Resource is required by a system component. + */ + SYSTEM = 0; + + /** + * Resource is requested by a human interaction partner. + */ + HUMAN = 10; + } + + /** + * Specifies a request's conflict resolution policy, i.e., gives the + * scheduler a hint how it is allowed to modify the request in case of + * conflicts. + */ + enum Policy { + + /** + * Only allocate as a a single, unmodified interval. + */ + PRESERVE = 0; + + /** + * Allocate maximum amount of time available, shrink interval if needed. + */ + MAXIMUM = 10; + + /** + * Allocate the first time slot available, shrink interval if needed. + */ + FIRST = 20; + + } + + /** + * Identifier of the current resource allocation attempt, i.e., not the + * resource itself. + */ + required string id = 10; + + /** + * Current state of resource allocation. + */ + required State state = 20; + + /** + * Priority of resource allocation. + */ + required Priority priority = 30; + + /** + * Initiator of resource allocation. + */ + required Initiator initiator = 40; + + /** + * Conflict resolution policy. + */ + required Policy policy = 50; + + /** + * Expected starting point and end of resource allocation. + */ + required .rst.timing.Interval slot = 60; + + /** + * In case of conflicts, outter limits for shifting the interval can be + * specified using a constraint interval. + */ + optional .rst.timing.Interval constraints = 70; + + /** + * Specifies the resources that are requested for allocation. The collection + * should at least contain one element. Elements can be specified in an + * arbitrary order. Given resources are treated in its entirety, i.e., + * if one element causes a conflict, the whole allocation is affected. + */ + repeated string resource_ids = 80; + + /** + * A description of or reason for the resource allocation request. + */ + optional string description = 90; +} -- 1.9.1