/** \file
 *
 *  Contains the HFRadarCompactModelForecaster class declaration.
 *
 *  HFRadarCompactModelForecaster.h should only be included by
 *  HFRadarCompactModelForecaster.cpp
 *  Other classes should include HFRadarCompactModelForecasterIF.h
 *
 *  Copyright (c) 2013,2014 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef HFRADARCOMPACTMODELFORECASTER_H_
#define HFRADARCOMPACTMODELFORECASTER_H_

#include <stdint.h>

#include "component/SyncComponent.h"
#include "data/Mtx.h"

#include "estimationModule/HFRadarCompactModelForecasterIF.h" // for HFRadarCompactModelForecasterIF::TOTAL_HOURS

class ConfigReader;
class UniversalDataReader;

/**
 *  HFRadarCompactModelForecaster component
 *
 *  HFRadarCompactModelForecaster.h should only be included by
 *  HFRadarCompactModelForecaster.cpp
 *  Other classes should include HFRadarModelCalcIF.h
 *
 *  Implements onboard models work.
 *
 *  TODO: Fill in more description.
 *
 *  \ingroup modules_estimation
 */
class HFRadarCompactModelForecaster : public SyncEstimationComponent
{
public:
    HFRadarCompactModelForecaster( const Module* module );
    virtual ~HFRadarCompactModelForecaster();

    /// Initialize function
    void initialize( void );

    /// The actual "payload" of the component
    void run();

protected:

    bool loadHistory( void );
    void forecast( void );
    void publishForecast( void );
    Mtx glm2fwd( const Mtx& buf );

    int verbosity_; // an integer setting to control syslog messages

    // Neural net parameters
    const Mtx xlags_;
    const Mtx ulags_;
    const Mtx netInpMean_;
    const Mtx netTpca_;
    const Mtx netW1_;
    const Mtx netB1_;

    int historyHours_; // # hours of history to feed in
    int projectionHours_; // # hours to forecast into the future


    Mtx expansionCoefficients_;
    Mtx forecastExpansionCoefficients_;
    double forecastEpochSeconds_[ HFRadarCompactModelForecasterIF::TOTAL_HOURS ];
    Timestamp forecastStartTime_;

    ConfigReader* ignoreECsMoreRecentThanCfgReader_;
    UniversalDataReader* platformCommunicationsReader_;
    BlobWriter* forecastExpansionCoefficientsWriter_;
    BlobWriter* forecastTimesWriter_;

private:
    // Note that the copy constructor below is private and not given a body.
    // Any attempt to call it will return a compiler error.
    HFRadarCompactModelForecaster( const HFRadarCompactModelForecaster& old ); // disallow copy constructor

};

#endif /* HFRADARCOMPACTMODELFORECASTER_H_ */
