parameter_values = (('num_sweeps', '30'),
                    ('num_simulations', '1'),
                    ('num_banks', '1'),
                    ('num_firms', '1'),
                    ('num_households', '1'),
                    ('bank_directory', 'agents/banks/'),
                    ('firm_directory', 'agents/firms/'),
                    ('household_directory', 'agents/households'),
                    ('measurement_config', 'measurements/test_output.xml')
                   )

"""
Explanation: Configure Solow Model
In this notebook, you can set the parameters of the Solow model. 
This notebook is part of three notebooks which can be used to work with the Black Rhino Solow model. These notebooks are:
1. Configure_Solow notebook
2. Run_Solow notebook,
3. Analyse_Solow notebook.
The current notebook is highlighted.
In the Black Rhino framework, parameters are stored in xml files. Using this notebook, you can set change them. Below you will find the parameter inputs for this model.
End of explanation
"""


environment = ET.Element('environment')

"""
Explanation: To translate this to an xml document, which the framework can read, we first need create an ET element.
End of explanation
"""


parameters = []
for x in range(len(parameter_values)):
    parameters.append(ET.SubElement(environment, 'parameter'))

"""
Explanation: Next, the parameter elements are created.
End of explanation
"""


for idx, p in enumerate(parameters):
    p.set('type', 'static')
    p.set('name', parameter_values[idx][0])
    p.set('value', parameter_values[idx][1])

xml_params = ET.tostring(environment, encoding="unicode")
myfile = open("environments/solow_parameters.xml", "w")
myfile.write(xml_params)
myfile.close()

"""
Explanation: Next, parameter attributes for type, name and value are added to the XML elements.
End of explanation
"""


