Poker, a Process-Interaction Simulator and Controller for Use in Collaborative Simulation
Total Page:16
File Type:pdf, Size:1020Kb
POKer, a Process-Interaction Simulator and Controller for use in Collaborative Simulation Andriy Levytskyy, Eugene J.H. Kerckhoffs Delft University of Technology Faculty of Information Technology and Systems Mediamatica Department Zuidplantsoen 4, 2628 BZ Delft, The Netherlands e-mail: [email protected] and a subset of it, a process interaction world-view Keywords [20], which is of particular interest to us. This world- Discrete-Event simulation, Process-Interaction view gained its popularity due to the easiness of world-view, operational semantics, scripting mapping real-world processes into this formalism, languages, Python. and easiness of comprehending the essence of the process by a human. The above, as well as special application Abstract requirements for the simulation system we seek, In this paper we present the ideas and inspired us to develop our own special-purpose implementation of a small process-interaction kernel simulation software while trying to preserve its and cover its evolution from operational semantics connection to the formal background. In this paper of process-oriented simulation languages to the we present the ideas and implementation of a small current state of the kernel as (simulation) core of a process-interaction kernel and cover its evolution collaborative environment controller. from operational semantics of process oriented simulation languages to the current state of the kernel as (simulation) core of a collaborative 1. Introduction environment controller. Simulation as problem-solving methodology has been widely adopted in many practical domains. 2. View on the environment Users are free to select from a number of available general-purpose simulation software [14, 4] or, in 2.1. Functional overview case of special user requirements, a custom software In order to understand better the initial requirements system can be developed. The latter scenario has a for our custom system, we give a brief functional potential negative side effect: simulation often overview of the intended environment (for more becomes interpreted and applied by developers in a information, please see [9]). It is based on a three less formal way. As the result, it becomes more layer architecture: (i) front-end layer (high-level difficult to reason about properties of such front-ends), (ii) middle layer (environment simulation systems and prove their correctness. controller), and finally, (iii) back-end layer On the other hand, Simulation and Modelling formal (distributed heterogeneous hardware and software theory provides a reliable framework to support the resources). entire process of modelling and simulation [18]. The front layer consists of a number of client-side There exist formal works dedicated to the study of front-ends . They provide users with a high level simulation languages and simulators for some major GUI to the system (e.g., web-based interface), formalisms and world-views [2, 3, 2]. They provide enable them to operate in the environment, formally proven semantic backgrounds and accomplish background routine jobs necessary for implementation reference for development of execution of users’ activities, and finally, custom simulation systems. One of the widely used communicate with the middle layer. basic formalisms is the discrete event formalism, Requirements Property Description Handling external events Many software systems providing the process interaction world-view do not natively support external events. Scheduling mechanism should be aware of external and internal events, and as a result, properly schedule the involved event notices on the same EL. Support of both real-time and as- Transparently processing both types of processes (programs) soon-as-possible time regimes intermixed on the same EL. Adjustments in synchronization Connectivity to environment resources changes operational semantics mechanism of standard simulation synchronisation mechanism. Programming language Language constructs are needed to support mapping a sequence of user’s real-world activities into a process. Transparent support of different For users the most natural framework is process interaction. For the world-views simulator, which deals with resource-oriented scenarios, event scheduling is more proper. Freedom of customization We need powerful constructs to represent components of our system and freedom to adjust them easily for our needs. Unrestricted monitoring of the 3rd party systems are often ‘black boxes’ and it would be impossible or activities in the environment very difficult to make them provide all the time full overview on all that is happening in the environment. Easy integration with other Web, distributed objects, network programming, inter-process industry technologies communication, de-facto standard system development languages (C/C++, Java), multi-platform support, are all needed to develop an environment as described in section 2.1. Table 1. List of requirements for the simulation system and description of resulting properties. connection both to recognise web-users as they log The middle layer of the environment consists of one in the environment, and associate them with their central persistent environment controller, which respective processes. controls and provides access to all the resources distributed in the environment. A user can The back-end layer consists of a number of shared interactively conduct a sequence of activities environment resources (applications) that are involving execution of applications on different accessible to the controller and multiple web-users platforms or trust this job to the controller. In the via, for instance, the Common Gateway Interface. latter case, the controller uses a special program The state of the real-world resources is represented called process (which prescribes the sequence of within the controller in a set of proxy objects called activities to be accomplished on behalf of the user). resources. A library of proxy modules provides the A kind of gateway mechanism is used to provide gateway mechanism of the controller with standard connectivity to the external resources. It interacts subroutines that “wrap” the real-world resources. with the user via interactive web pages (if additional Each proxy wrapper is developed for a particular input parameters are required to run the resource), (often legacy) application and stores the interface controls the session with the real resource, and definition of that server application and knows maintains the communication with the web-user. where to find the implementation of that resource. This mechanism conducts functionality essentially Finally, some kind of an inter-process (not to be related to that of Object Request Broker, and thus confused with user processes!) communication is has a very high appeal to apply one of the object needed to support communication between the technology standards. If the user logs out from the software components of this distributed system, the connection between the user and his/her environment. program (if any) is closed, but it does not affect the execution of the program in the system. A user state- saving mechanism is used by the server-side program causes the state of the environment (in our 2.2. Roles of POKer case, synthetic environment) to move (Þ) from We have chosen to base the environment’s middle state to state’. The state of the environment is layer on a process-oriented simulator (called POKer) represented by three components <EL, R, D> (for because the authors are charmed by the easiness, more details, please see [10]). EL is an ordered simplicity and naturality of this approach, which collection of processes sorted out by the values of exactly meets our aims (for more information, please their next event times. R is a dictionary of resources see [9]). In the following we list some major tasks (proxy objects that represent the real-world (controller and simulator related) that such a resources). D is a helper component that stores middleware has to handle as a part of the intended process classes (generic user processes) definitions environment: and class instances, and thus forms a declaration · Resource management (resource integrity and space. synchronisation) We begin the development of the intended process- · Interactive and off-line operation (real-time/as- interaction kernel by identifying the operational soon-as-possible time management) semantics of the kernel commands (language · Mapping the history of the user’s activities into constructs). For that purpose, results provided in the a form of a process works of Birtwistle and Tofts [2] give us sufficient · Programming a sequence of activities for initial background. In the following, we give automated execution descriptions of the currently implemented · Handling external requests from multiple users commands in the functional-language like notation · User-state integrity adopted from their work. · Object Request Broker functionality, etc… This list is by no means a complete enumeration of 3.1. decP(classId, classDef) the requirements. In table 1 these rather low-level Informally, it declares a process class by saving the requirements are summarised for brevity into more class definition classDef under name classId. general groups and are translated into the desired properties of the simulator’s part of the controller. Semantics: Due to the unique combination of the wanted decP (classId, classDef) Þ if classId Î D then error else properties, existing off-shell simulation languages let