#pragma once 
#include "ProcessorBase.h"
#include <iostream>
#include "Output.h"
#include <chrono>

namespace mdd {
    enum priority {
        MANUAL,
        STATIC,
        DYNAMIC,
        TIME
    };

    class ProcessorStandard : public ProcessorBase {
    private:
        struct module_priority {
            std::shared_ptr<IModule> module_ptr;
            size_t inputCounter;
            size_t changeCounter;
            size_t outputCounter;
            int time_priority;
            module_priority(std::shared_ptr<IModule> module, size_t inputs = 0, size_t outputs = 0, size_t change = 0);
        };
        std::vector<module_priority> _priority_list;
        int _maxIterations;
        priority _priorityEvaluation;
    protected:
        bool configureChild(const json& config) override;

    public:
        ProcessorStandard();
        std::vector<std::shared_ptr<IModule>> getModulePriority();
        state update() override;
        std::shared_ptr<IOutput> getIteration();
    };
}