def write_parameters_to_file(params, filename):
    """ Writes all parameters stored in a given Parameters object
        to a given file in the following format format:
        <param_name> {param_value}. If the file
        already exists, all parameters will be over-written with the new ones.

        Args:
            params (Parameters): parameters object.
            filename (str): file name where parameters must be written.
    """
    file_with_params = open(filename, 'w')
    for name, value in params.params.items():
        file_with_params.write('<' + name + '> {' + value + '}\n')
    file_with_params.close()
