parameters_testing_utilities.py
def _run_multiple_simulations(simulation_func: Callable,
                              parameter: str,
                              values: list) -> dict:
    """
    Runs simulations multiple times for all inputted values, that are
        meant to modify certain parameter, and should change the results
    """

    results = {}

    # Default parameters, into which the new parameter will be injected,
    #   but the rest will stay the same
    parameters = {
        "rho": 7850,
        "cp": 520,
        "lmbd": 50,
        "dt": 3,
        "object_length": 0.01,
        "place_of_interest": 0.0045,
        "number_of_elements": 100,
        "callback_period": 500,
        "robin_alpha": 13.5,
        "theta": 0.5,
        "window_span": 4,
        "tolerance": 1e-05,
        "init_q_adjustment": 20,
        "adjusting_value": -0.7,
        "experiment_data_path": "DATA.csv"
    }

    # Running the simulation for all the inputted values of the parameter
    for value in values:
        parameters[parameter] = value
        print("parameter: {}, value: {}".format(parameter, value))

        result = _run_simulation(simulation_func=simulation_func,
                                 parameters=parameters)
        results[value] = result
        print(result)

        # Sleeping some time to "cool off"
        time.sleep(0.1)

    return results

    Runs simulations multiple times for all inputted values, that are
        meant to modify certain parameter, and should change the results
    
Runs simulations multiple times for all inputted values, that are
meant to modify certain parameter, and should change the results
Runs simulations multiple times for all inputted values that are meant to modify certain parameter and should change the results
def _run_multiple_simulations(simulation_func: Callable,
                              parameter: str,
                              values: list) -> dict:
    results = {}
    parameters = {
        "rho": 7850,
        "cp": 520,
        "lmbd": 50,
        "dt": 3,
        "object_length": 0.01,
        "place_of_interest": 0.0045,
        "number_of_elements": 100,
        "callback_period": 500,
        "robin_alpha": 13.5,
        "theta": 0.5,
        "window_span": 4,
        "tolerance": 1e-05,
        "init_q_adjustment": 20,
        "adjusting_value": -0.7,
        "experiment_data_path": "DATA.csv"
    }
    for value in values:
        parameters[parameter] = value
        print("parameter: {}, value: {}".format(parameter, value))
        result = _run_simulation(simulation_func=simulation_func,
                                 parameters=parameters)
        results[value] = result
        print(result)
        time.sleep(0.1)
    return results
def _run_multiple_simulations ( simulation_func : Callable , parameter : str , values : list ) -> dict : results = { } parameters = { "rho" : 7850 , "cp" : 520 , "lmbd" : 50 , "dt" : 3 , "object_length" : 0.01 , "place_of_interest" : 0.0045 , "number_of_elements" : 100 , "callback_period" : 500 , "robin_alpha" : 13.5 , "theta" : 0.5 , "window_span" : 4 , "tolerance" : 1e-05 , "init_q_adjustment" : 20 , "adjusting_value" : - 0.7 , "experiment_data_path" : "DATA.csv" } for value in values : parameters [ parameter ] = value print ( "parameter: {}, value: {}" . format ( parameter , value ) ) result = _run_simulation ( simulation_func = simulation_func , parameters = parameters ) results [ value ] = result print ( result ) time . sleep ( 0.1 ) return results
Runs simulations multiple times for all inputted values, that are
meant to modify certain parameter, and should change the results
Runs simulations multiple times for all inputted values that are meant to modify certain parameter and should change the results
"""
    Runs simulations multiple times for all inputted values, that are
        meant to modify certain parameter, and should change the results
    """ # Default parameters, into which the new parameter will be injected, #   but the rest will stay the same # Running the simulation for all the inputted values of the parameter # Sleeping some time to "cool off"
simulation_func
Callable
parameter
str
values
list