so let me explain how this works. This is less of a Machine learning program, and more of an evolution simulator. each neuron goes through a test, in what I have right now, they are just multiplied by a number, and Neuron5 will always be the largest. whichever neuron has the largest value will have its level(value) used as the base level for the next generation, and the cycle continues.
I need help with the pointer "*NeuronCarier" I cant actually set it to be a pointer where I input into my "NeuralPorcessor" function under "NeuronMain".
also in the for loop I have, which allows multiple generations to be made, I need a way to use that pointer to substitute the largest value of a generation back into the for loop as the starting lvl of the next generation.
#pragma once
//Global_obj_ptr_var holds global info shared between all classes
class Global_obj_ptr_var
{
public:
//Neurons represent individuals. Their values can me thought of as levels. they all start at level 1
double
Neuron1 = 1,
Neuron2 = 1,
Neuron3 = 1,
Neuron4 = 1,
Neuron5 = 1;
double *NeuralCarier;
};
class NeuralNet : public Global_obj_ptr_var
{
public:
void NeuronMain();
void NeuronPath(double Neuronx, double Multiple)
{
Neuronx * Multiple;
}
void NeuralProcessor(
double Neuron1,
double Neuron2,
double Neuron3,
double Neuron4,
double Neuron5,
double *NeuronCarier);
};
the code is a little messy, but I will clean it up after I get it working properly.
I need help with the pointer "*NeuronCarier" I cant actually set it to be a pointer where I input into my "NeuralPorcessor" function under "NeuronMain".
explain this again, with more words.
I see line 32 above where it is indeed a pointer and is being input into the function. Is there an error message there? Or something you need done differently?
There is probably something I am not understanding about what you are trying to do, but it looks to me like these
*NeuronCarier = Neuron5;
should possibly be
NeuronCarier = &Neuron5; //maybe? you are not using its pointer-ness, you are always dereferencing it so it may as well not be a pointer?
And, more importantly, if you do mean to do it the way you did, where are you getting memory for the pointer?
there is no error, I just cant put a * behind it, but I guess I dont need to? and I am not to good with pointers and I always forget to put the & behind the variables. I may just remove the pointer all together, as I have my classes inheriting the same info anyway I dont need a pointer. I just need something to take the largest value and input it back into the for statement as the base level for the next generation.
it does not matter anymore. I changed how the program works.
But if your still interested, the pointer was meant to get info from whichever Neuron was the largest, then plug that back into the other neurons so they all start at whatever number the largest Neuron was at in the last generation.