Пример #1
0
def main():
    env = Environment()
    # seed = int(time.time())

    # General testing ...
    seed = 1487736569
    env.isdva = 10.
    # env.mdc_count = 5

    logger.debug("Random seed is %s", seed)
    np.random.seed(seed)
    sim = TOCS(env)
    sim.run()
Пример #2
0
def run_flower(parameters):
    """

     :param parameters:
     :type parameters: Parameters
     :return:
     """

    env = Environment()
    env.segment_count = parameters.segment_count
    env.mdc_count = parameters.mdc_count
    env.isdva = parameters.isdva
    env.isdvsd = parameters.isdvsd
    env.comms_range = parameters.radio_range

    flower_sim = FLOWER(env)
    print("Starting FLOWER at {}".format(datetime.datetime.now().isoformat()))
    print("Using {}".format(parameters))
    start = time.time()
    runner = flower_sim.run()

    results = Results(runner.maximum_communication_delay(),
                      runner.energy_balance(), 0., runner.average_energy(),
                      runner.max_buffer_size())

    print("Finished FLOWER in {} seconds".format(time.time() - start))
    return results
Пример #3
0
def main():
    env = Environment()
    seed = int(time.time())

    # General testing ...
    # seed = 1484764250
    # env.segment_count = 12
    # env.mdc_count = 5

    # seed = 1487736569
    env.comms_range = 125

    logger.debug("Random seed is %s", seed)
    np.random.seed(seed)

    sim = FOCUS(env)
    sim.run()
    sim.show_state()
Пример #4
0
def main():
    env = Environment()
    # seed = int(time.time())

    # General testing ...
    # seed = 1484764250
    # env.segment_count = 12
    # env.mdc_count = 5

    seed = 1487736569
    env.comms_range = 125

    # Specific testing ...
    # seed = 1483676009  # center has in-degree of 3
    # seed = 1483998718  # center has in-degree of 2

    logger.debug("Random seed is %s", seed)
    np.random.seed(seed)
    sim = MINDS(env)
    sim.run()
    sim.show_state()
Пример #5
0
def main():
    env = Environment()
    # seed = int(time.time())

    # General testing ...
    # seed = 1484764250
    # env.segment_count = 12
    # env.mdc_count = 5

    seed = 1487736569
    env.comms_range = 125

    # Specific testing ...
    # seed = 1483676009  # center has in-degree of 3
    # seed = 1483998718  # center has in-degree of 2

    logger.debug("Random seed is %s", seed)
    np.random.seed(seed)
    sim = MINDS(env)
    sim.run()
    sim.show_state()
Пример #6
0
def run_flower(parameters):
    """

     :param parameters:
     :type parameters: Parameters
     :return:
     """

    env = Environment()
    env.segment_count = parameters.segment_count
    env.mdc_count = parameters.mdc_count
    env.isdva = parameters.isdva
    env.isdvsd = parameters.isdvsd
    env.comms_range = parameters.radio_range

    flower_sim = FLOWER(env)
    print(
        "Starting FLOWER at {}".format(datetime.datetime.now().isoformat()))
    print("Using {}".format(parameters))
    start = time.time()
    runner = flower_sim.run()

    results = Results(runner.maximum_communication_delay(),
                      runner.energy_balance(),
                      0.,
                      runner.average_energy(),
                      runner.max_buffer_size())

    print("Finished FLOWER in {} seconds".format(time.time() - start))
    return results
Пример #7
0
def main():
    env = Environment()

    import time
    seed = int(time.time())

    # General testing ...
    # seed = 1488683682
    env.segment_count = 12
    env.mdc_count = 12
    #env.isdva = 64
    env.comms_range = 30

    logger.debug("Random seed is %s", seed)
    np.random.seed(seed)
    start = time.time()
    sim = LOAF(env)
    sim.run()
    finish = time.time()
    delta = finish - start
    logger.debug("Run time: %f seconds", delta)
    sim.show_state()