#ifndef __SHAREWIZ_CONNECTION_H__ #define __SHAREWIZ_CONNECTION_H__ //#include //#include // Connection class. // // A Connection links two Neurons. class Neuron; typedef std::shared_ptr pNeuronX; typedef std::vector pNeuron; class Connection { private: int index; double weight; double deltaWeight; double error; double momentum; // alpha. // For DQN. // Should we re-use weight as Q and deltaWeight as R. double Q; double R; double odds; // Odds of being chosen as next action for DQN. double randomizeWeight(void); pNeuronX from; pNeuronX to; public: Connection(); Connection(const pNeuronX& from, const pNeuronX& to); double getError(void); void setError(const double& e); int getIndex(void); void setIndex(const int& index); double getWeight(void); void setWeight(const double& w); double getDeltaWeight(void); void setDeltaWeight(const double& w); double getMomentum(void); void setMomentum(const double& momentum); double getQ(void); void setQ(const double& _Q); double getR(void); void setR(const double& _R); pNeuronX& getFrom(void); void setFrom(const pNeuronX& from); pNeuronX& getTo(void); void setTo(const pNeuronX& to); void printOutput(void); }; #endif