Пример #1
0
    def apply(self, state):
        """
        Updates the execution state according to the event

        :param state: current execution state
        """
        Action.create_action(self.action_type, self.description, state, self.timestamp)
Пример #2
0
    def apply(self, state):
        """
        Updates the execution state according to the event

        :param state: current execution state
        """
        action = Action.obtain_action(self.action_type, self.description, state, self.timestamp)
        resource = state.resources.get_resource(self.resource_name)
        action.assign_resource(resource)
Пример #3
0
    def apply(self, state):
        """
        Updates the execution state according to the event

        :param state: current execution state
        """
        action = Action.obtain_action(self.action_type, self.description, state, self.timestamp)
        resource = action.get_assigned_resource()
        if resource is not None:
            resource.host(action, self.timestamp)
            action.hosted(resource, self.timestamp)
        else:
            print("Unassigned resource to action " + str(action))