Exemplo n.º 1
0
    def __init__(self, verbose=1, fasttime=True, time_limit=None):
        """
        :param verbose: Control amount of printed messages (0 for none, 1+ for more)
        :param fasttime: When True run in fasttime, otherwise run in real time
        :param time_limit: Maximum simulation time (in seconds). None for no limit
        """
        self.verbose = verbose

        # Vehicle instances
        self.icInstances = []
        self.icStartDelay = []
        self.icTimeLimit = []
        self.gsInstances = []
        self.tfList = []

        # Set default communication channel
        self.comm_channel = cm.ChannelModel()
        self.network = None

        # Simulation environment conditions
        self.wind = [(0, 0)]
        self.mergeFixFile = None
        self.home_gps = [0, 0, 0]
        self.fasttime = fasttime
        self.dT = 0.05
        self.time_limit = time_limit

        # Simulation status
        self.count = 0
        self.t0 = 0
        self.current_time = 0
        self.windFrom, self.windSpeed = self.wind[0]
Exemplo n.º 2
0
 def SetCommunicationModel(self, propagation_model, reception_model,
                           propagation_params, reception_params):
     """
     :param propagation_model: name of signal propagation model
         ex: "NoLoss", "FreeSpace", "TwoRayGround"
     :param reception_model: name of V2V reception model,
         ex: "Perfect", "Deterministic", "Rayleigh", "Nakagami"
     :param propagation_params: dict of keyword params for propagation model
     :param reception_params: dict of keyword params for reception model
     """
     pm = get_propagation_model(propagation_model, propagation_params)
     reception_params["propagation_model"] = pm
     rm = get_reception_model(reception_model, reception_params)
     self.comm_channel = cm.ChannelModel(pm, rm)
Exemplo n.º 3
0
    def __init__(self,
                 propagation_model="NoLoss",
                 reception_model="Perfect",
                 propagation_params={},
                 reception_params={},
                 verbose=1,
                 fasttime=True,
                 time_limit=None):
        """
        :param propagation_model: name of signal propagation model
            ex: "NoLoss", "FreeSpace", "TwoRayGround"
        :param reception_model: name of V2V reception model,
            ex: "Perfect", "Deterministic", "Rayleigh", "Nakagami"
        :param propagation_params: dict of keyword params for propagation model
        :param reception_params: dict of keyword params for reception model
        """
        self.verbose = verbose

        # Vehicle instances
        self.icInstances = []
        self.icStartDelay = []
        self.icTimeLimit = []
        self.tfList = []

        # Communication channel
        pm = get_propagation_model(propagation_model, propagation_params)
        reception_params["propagation_model"] = pm
        rm = get_reception_model(reception_model, reception_params)
        self.comm_channel = cm.ChannelModel(pm, rm)
        if verbose > 0:
            print("Reception model: %s" % rm.model_name)

        # Simulation environment conditions
        self.wind = [(0, 0)]
        self.commDelay = 0
        self.mergeFixFile = None
        self.home_gps = [0, 0, 0]
        self.fasttime = fasttime
        self.dT = 0.05
        self.time_limit = time_limit

        # Simulation status
        self.count = 0
        self.current_time = 0
        self.windFrom, self.windSpeed = self.wind[0]