Exemple #1
0
    # Parameters of the world
    initial_temperature = 20  # 20 C is Ambient temperature
    length = 20
    width = 20
    height = 20

    # Create the world
    w1 = World(initial_temperature, length, width, height)
    w1.add_object(h)
    w1.add_object(cc)

    # Experiment Parameters
    time_of_experiment = 80.  # ten seconds
    nb_hazards = int(time_of_experiment / 8.)  # One hazard for 10 seconds
    print("There will be ", nb_hazards, "hazards in this experiment")

    # Plan hazards
    hset = HazardSet()
    hset.plan_hazards(time_of_experiment, nb_hazards)

    print('Simulation Initialisation... Finished.')

    # Run the experiment with the parameters above
    h.activate()
    w1.run_experiment(time_of_experiment, cc, h, hset)
    h.deactivate()

    # Delete the objects at the end of the experiment
    w1.delete_object(h)
    w1.delete_object(cc)