/** @file main.cpp
 *
 *  @author Cory Alexander Balaton (coryab)
 *  @author Janita Ovidie Sandtrøen Willumsen (janitaws)
 *
 *  @version 1.0
 *
 *  @brief Implementation of the testing library
 *
 *  @bug No known bugs
 * */
#include "WaveSimulation.hpp"
#include "utils.hpp"

#include <fstream>

void probability_deviation()
{
    WaveSimulation sim_no_slits(.005, 2.5e-5, .008, .25, .5, .05, .05, 200.,
                                0.);

    WaveSimulation sim_slits(.005, 2.5e-5, .008, .25, .5, .05, .10, 200., 0.,
                             0.02, .5, .05, .05, 2);

    sim_no_slits.probability_deviation(
        "data/probability_deviation_no_slits.txt", true);
    sim_slits.probability_deviation("data/probability_deviation_slits.txt", true);
}

void color_map()
{
    WaveSimulation sim(.005, 2.5e-5, .002, .25, .5, .05, .20, 200., 0., 0.02,
                       .5, .05, .05, 2);

    std::vector<double> times{0., .001, .002};
    sim.solve("data/color_map.txt", times);
}

void detector_screen()
{
    WaveSimulation *sim = new WaveSimulation(
        .005, 2.5e-5, .002, .25, .5, .05, .20, 200., 0., 0.02, .5, .05, .05, 1);

    sim->solve("data/screen/single_slit.txt");

    delete sim;
    sim = new WaveSimulation(.005, 2.5e-5, .002, .25, .5, .05, .20, 200., 0.,
                             0.02, .5, .05, .05, 2);

    sim->solve("data/screen/double_slit.txt");

    delete sim;
    sim = new WaveSimulation(.005, 2.5e-5, .002, .25, .5, .05, .20, 200., 0.,
                             0.02, .5, .05, .05, 3);

    sim->solve("data/screen/triple_slit.txt");
}

int main()
{
    DEBUG("Before probability deviation");
    probability_deviation();
    DEBUG("Before color map");
    color_map();
    DEBUG("Before detector screen");
    detector_screen();

    // std::ofstream ofile;
    // ofile.open("test.txt");
    // WaveSimulation sim(.005, 2.5e-5, .008, .25, .5, .05, .10, 200., 0.,
    // 0.02, .5, .05, .05, 2);
    // sim.solve(ofile);

    return 0;
}
