<!DOCTYPE html>
<html>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="{{ css_style_sheet }}" />
<link rel="stylesheet" type="text/css" href="{{ table_style }}" />
<link rel="stylesheet" type="text/css" href="{{ custom_style }}" />

<head>
    <title>{{ run_name }}FitBenchmarking problem summary page</title>
</head>

<body>
    <div class="wrapper">
        <div class="content">
            <div class="post-title">
                <h1>{{ title }}</h1>
                <hr>
            </div>
            <p>{{ description }}</p>
            <hr>
            <section class="accordion">
                <input type="checkbox" name="collapse" id="start-accordion" checked="checked">
                <h2 class="handle">
                    <label for="start-accordion">Problem Outline</label>
                </h2>
                <div class="content">
                    <p><em>Number of parameters</em>: {{ n_params }}</p>
                    <p><em>Number of data points</em>: {{ n_data_points }}</p>
                    <p><em>Functions</em>:</p>
                    <table>
                        <colgroup>
                            <col width="45%" />
                            <col width="55%" />
                        </colgroup>
                        <thead valign="bottom">
                            <tr>
                                <th class="head">Form</th>
                                <th class="head">Parameters</th>
                            </tr>
                        </thead>
                        <tbody valign="top">
                            <tr>
                                <td>{{ equation }}</td>
                                <td>{{ initial_guess }}</td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="row">
                      {% if initial_plot_available %}
		       <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ initial_plot }}"></iframe>
                      {% else %}
                        <h3>{{ initial_plot }}</h3>
                      {% endif %}
                    </div>
                </div>
            </section>
            <section class="accordion">
                <input type="checkbox" name="collapse" id="comparison-accordion" checked="checked">
                <h2 class="handle">
                    <label for="comparison-accordion">Comparison</label>
                </h2>
                <div class="content">
                    <p>
                        {% if best_results|length == 1 %}
                        This plot shows a comparison of the runs. The minimizer
                        which produced closest fit is in bold, with the other
                        minimizers shown as thinner lines for context.
                        {% else %}
                        This plot shows a comparison of the runs across cost
                        functions. Colours are used to distinguish between fits
                        obtained using each cost function. Within a cost function,
                        the minimizer which produced closest fit is in bold and
                        the other minimizers are shown as thinner lines for context.
                        {% endif %}
                        <br>Please note that this plot is intended for use as an
                        indication of the variety of the fits that were obtained
                        for specific details, please consult the individual support
                        pages.
                    </p>
                    <div align="center" class="figure align-center">
                        {% if summary_plot_available %}
		            <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ summary_plot }}"></iframe>
                        {% else %}
                            <h3>{{ summary_plot }}</h3>
                        {% endif %}
                    </div>
                </div>
            </section>

            {% if best_results|length == 1 %}
                <section class="accordion">
                    <input type="checkbox" name="collapse" id="best-accordion">
                    <h2 class="handle">
                        <label for="best-accordion">{{ categories[0] }}: {{ best_results[0].modified_minimizer_name(True) }}</label>
                    </h2>
                    <div class="content">
                        <p>This is the best fit of the minimizers used.</p>

                        <p><em>Minimizer</em>: {{ best_results[0].modified_minimizer_name(True) }}</p>
                        <p><em>Functions</em>:</p>
                        <table>
                            <colgroup>
                                <col width="36%" />
                                <col width="64%" />
                            </colgroup>
                            <thead valign="bottom">
                                <tr>
                                    <th class="head">Form</th>
                                    <th class="head">Parameters</th>
                                </tr>
                            </thead>
                            <tbody valign="top">
                                <tr>
                                    <td>{{ equation }}</td>
                                    <td>{{ best_results[0].fin_function_params }}</td>
                                </tr>
                            </tbody>
                        </table>
                        <div align="center" class="figure align-center">
                            {% if best_plots_available[0] %}
			        <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ best_plots[0] }}"></iframe>
                            {% else %}
                                <h3>{{ best_plots[0] }}</h3>
                            {% endif %}
                        </div>
                    </div>
                </section>
            {% else %}
                {% for cat in categories %}
                    <section class="accordion">
                        <input type="checkbox" name="collapse" id="cf{{ loop.index0 }}-accordion">
                        <h2 class="handle">
                            <label for="cf{{ loop.index0 }}-accordion">{{ categories[loop.index0] }}:
                                {{ best_results[loop.index0].modified_minimizer_name(True) }}</label>
                        </h2>
                        <div class="content">
                            <p>{{ plot_descriptions[loop.index0] }}</p>

                            <p><em>Minimizer</em>: {{ best_results[loop.index0].modified_minimizer_name(True) }}</p>
                            <p><em>Functions</em>:</p>
                            <table>
                                <colgroup>
                                    <col width="36%" />
                                    <col width="64%" />
                                </colgroup>
                                <thead valign="bottom">
                                    <tr>
                                        <th class="head">Form</th>
                                        <th class="head">Parameters</th>
                                    </tr>
                                </thead>
                                <tbody valign="top">
                                    <tr>
                                        <td>{{ equation }}</td>
                                        <td>{{ best_results[loop.index0].fin_function_params }}</td>
                                    </tr>
                                </tbody>
                            </table>
                            <div align="center" class="figure align-center">
                                {% if best_plots_available[loop.index0] %}
				    <iframe width="100%" height="500" frameborder="0" seamless="seamless" scrolling="no" src="{{ best_plots[loop.index0] }}"></iframe>
                                {% else %}
                                    <h3>{{ best_plots[loop.index0] }}</h3>
                                {% endif %}
                            </div>
                        </div>
                    </section>
                {% endfor %}
            {% endif %}
            <div align="center" class="figure align-center">
                <button class="btn default" onclick="history.go(-1)">
                    <i class="fa fa-arrow-left"></i>
                </button>
            </div>
        </div>
    </div>
</body>

</html>
