#pragma once

#include "../general_model/TimeSliceCalibrator.h"
#include "../random_process/InterestRateTimeSliceProcess.h"
#include "../generic/Algorithm.h"

class SingleCurrencyCalibrator : public TimeSliceCalibrator
{
private:

	virtual void calibrate_T0(const InterestRateTimeSliceProcess* currency);
	virtual void calibrate(const InterestRateTimeSliceProcess* currency);

protected:

	gelib::d_vector m_calibration_factors;
	gelib::d_vector m_arrow_debreu;

public:

	static std::unique_ptr<SingleCurrencyCalibrator> construct();

	virtual void initialise(const std::vector<size_t>& grid_sizes, const MFMBase* model) override;

	virtual void calibrate_at_T0(std::vector<std::unique_ptr<TimeSliceProcess>>& processes_at_T0) override;

	virtual void calibrate(std::vector<std::unique_ptr<TimeSliceProcess>>& processes) override;

	virtual void calibrate_next(TimeSliceCalibrator& next_calibrator, std::vector<std::unique_ptr<TimeSliceProcess>>& current_processes, std::vector<std::unique_ptr<TimeSliceProcess>>& next_processes) override;
	// TODO doesn't make sense inheriting these
	double weight_vector(gelib::d_vector& in);

	virtual double roll_back(std::vector<double> const& spread) const override;

	//virtual bool calculates_arrow_debreu() const override;

	std::vector<double>& get() override;

};