<reponame>madhawav/DASPythonClient<filename>DAS4PythonAPI/EventSimulator/SimulationProperties.py<gh_stars>0
import random

from DAS4PythonAPI.ObjectMapping.APIObject import APIObject, NotSet
from DAS4PythonAPI.ObjectMapping.FieldMapping import FieldMapping
from DAS4PythonAPI.__Util import decodeField

ran = random


class SimulationProperties(APIObject):
    '''
    SimulationProperties API Object of FeedSimulationConfiguration.
    '''

    def __init__(self, simulationName="Simulation_" + str(random.randint(1, 1000)), timestampStartTime=NotSet(),
                 timestampEndTime=NotSet(), noOfEvents=NotSet(), timeInterval=NotSet()):
        '''
        Instantiates SimulationProperties
        :param simulationName: name of simulation
        :param timestampStartTime: 
        :param timestampEndTime: 
        :param noOfEvents: 
        :param timeInterval: 
        '''
        self._setup(field_mapping={"simulationName": FieldMapping(str), "timestampStartTime": FieldMapping(int),
                                   "timestampEndTime": FieldMapping(int), "noOfEvents": FieldMapping(int),
                                   "timeInterval": FieldMapping(int)})

        self.simulationName = simulationName
        self.timestampStartTime = timestampStartTime
        self.timestampEndTime = timestampEndTime
        self.noOfEvents = noOfEvents
        self.timeInterval = timeInterval

    @classmethod
    def parse(cls, jsonObject):
        '''
        Converts a Python Class Object (from JSON) to SimulationProperties Object.
        :param jsonObject: 
        :return: 
        '''
        result = SimulationProperties(simulationName=decodeField(jsonObject["simulationName"], str))
        result._parse(jsonObject)
        return result

import random

from DAS4PythonAPI.ObjectMapping.APIObject import APIObject, NotSet
from DAS4PythonAPI.ObjectMapping.FieldMapping import FieldMapping
from DAS4PythonAPI.__Util import decodeField

ran = random


class SimulationProperties(APIObject):
    '''
    SimulationProperties API Object of FeedSimulationConfiguration.
    '''

    def __init__(self, simulationName="Simulation_" + str(random.randint(1, 1000)), timestampStartTime=NotSet(),
                 timestampEndTime=NotSet(), noOfEvents=NotSet(), timeInterval=NotSet()):
        '''
        Instantiates SimulationProperties
        :param simulationName: name of simulation
        :param timestampStartTime: 
        :param timestampEndTime: 
        :param noOfEvents: 
        :param timeInterval: 
        '''
        self._setup(field_mapping={"simulationName": FieldMapping(str), "timestampStartTime": FieldMapping(int),
                                   "timestampEndTime": FieldMapping(int), "noOfEvents": FieldMapping(int),
                                   "timeInterval": FieldMapping(int)})

        self.simulationName = simulationName
        self.timestampStartTime = timestampStartTime
        self.timestampEndTime = timestampEndTime
        self.noOfEvents = noOfEvents
        self.timeInterval = timeInterval

    @classmethod
    def parse(cls, jsonObject):
        '''
        Converts a Python Class Object (from JSON) to SimulationProperties Object.
        :param jsonObject: 
        :return: 
        '''
        result = SimulationProperties(simulationName=decodeField(jsonObject["simulationName"], str))
        result._parse(jsonObject)
        return result
SimulationProperties API Object of FeedSimulationConfiguration. Instantiates SimulationProperties         :param simulationName: name of simulation         :param timestampStartTime:          :param timestampEndTime:          :param noOfEvents:          :param timeInterval: Converts a Python Class Object (from JSON) to SimulationProperties Object.         :param jsonObject:          :return: