## 2 Resource Model
### Resource Allocation Mechanism  
In the RSDT definition, we have included characters, attributes and contexts. RODM will automatically decide the operations on them. All of the configurations and decisions made by the RODM are part of the contract between the resource provider and the cyber-physical system. RODM has the following four important responsibilities:  
1. It has to read the information included in the characters section of the RSDT and decided how to use the resources from this template. It has to hold the RSDT description, as well as the information on resource providers. 2. It has to use the attributes information in the RIN in order to achieve a real-time effect in the system. 3. It has to make decisions about how to manage and allocate resources. 4. It has to provide an interface to the CPS that can manage resources. From the above stated requirements, we have designed the RODM shown in Figure 1.  
It is clear that the RODM has three connectors, respectively, for the RSDT, RIN and interface to the CPS. All of the RSDTs have to register with RODM when they want to join the cyber-physical system. All of the generated RINs are monitored at run-time. The resource requesters have limited rights to interact with this system through the interface. \begin{table}
\begin{tabular}{c c} \hline
**Resource Name** & Alternating Current \\ \hline
**Resource ID** & 2013.12.1.1546 \\ \hline \multirow{4}{*}{**Attributes**} & Voltage: 6.3 kV \\  & Current:? \\  & Frequency: 50.02 Hz \\  & Phase: correct \\  & Power: 25,000 kilowatts/hour \\ \hline \end{tabular}
\end{table} 
Table 3: A Resource Instance Notation (RIN) sample generated from the RSDT. Besides acting as an interface between the resource and service, the decision engine is divided into four parts. Together, they make high-level decisions based on the real-time context. The four parts are the following:  
(1) The resource usage mechanism is the module that analyses the information from an RSDT and decides how to use the resources. Because the RODM machine has to make decisions at a high level, the resource usage mechanism module needs a special Resource Usage Specification Language in order to load the resource information from the registered RSDT. Some researchers [12,13] have proposed a resource usage specification language for distributed systems or virtual machines. Projects like Globus [14] and Condor [15] have their own solutions for resource management and allocation. In Globus, a \"Resource Specification Language\" (RSL) has been designed to describe the request and communicate information regarding the jobs [16]. In Condor [15], the \"classified ad\" mechanism can define constraints and mechanisms within the resource descriptions. In our approach, within RODM, we are trying to modify the syntax and mechanism of RSL to specify the usage mechanism of resources in CPS. (2) The resource policy filter is the module connected to the RIN monitor and that supports the exception handler for the RIN monitor. This module is a critical, important module in RODM to verify whether the support resources are correct for the tasks in the cyber-physical system. It is used to control the resource quality and then guarantee the security of resource management model. If a resource instance cannot pass this resource policy filter, the RODM machine will start the exception handler to handle the errors. (3) The scheduler is the connector between the cyber-physical system and this resource management RODM machine. All resources managed by the RODM machine need to provide some specified task from the cyber-physical system through the interface. Because both the cyber-physical system and resources used by the system could be distributed, large-scale and heterogeneous, the tasks need to be arranged to correctly allocate suitable resources. This scheduler module is designed so that it can arrange a large amount of different tasks coming from the interface. Figure 1: Structure of the resource operating decision machine (RODM).