Files
ia2005/backprop/neurone.cpp
2024-11-12 17:41:10 +01:00

44 lines
754 B
C++

#include "neurone.h"
Neurone::Neurone(){
nextNeurone=NULL;
weight=0.0;
}
Neurone::Neurone(const double w,const Neurone* next){
nextNeurone=(Neurone*)next;
weight=(double)w;
}
bool Neurone::getState() const{
return bool(weight > ACTIVE);
}
double Neurone::getWeight() const{
return weight;
}
void Neurone::setWeight(const double a){
weight=a;
}
void Neurone::setNextNeurone(const Neurone* next){
nextNeurone=(Neurone*)next;
}
Neurone* Neurone::getNextNeurone() const{
return nextNeurone;
}
void Neurone::operator =(double w){
weight = w;
}
Neurone& Neurone::operator =(const Neurone& n){
if(this!=&n){
weight = n.getWeight();
nextNeurone = n.getNextNeurone();
}
return *this;
}