#include <stdio.h>
#include "neural.h"
#include <malloc.h>
#include <time.h>
#include <stdlib.h>
#include <iostream>

using namespace std;

int nn(){
	NeuralNet *nene = new NeuralNet;
	cout << "Initialisiert..." << endl;
	nene->Initialize(5,3);
	return 0;
}


void NeuralNet::Initialize(int numNeuronsLayer,int numLayer) {
	int i;
	int j;
	int k;
	cout << "Running: Initialize()" << endl;
	layer = new Layer*[numLayer];
	
	for (i=0;i<numNeuronsLayer;i++){
		layer[i]->neurons  = new Neuron*[numNeuronsLayer];
		layer[i]->numNeurons = numNeuronsLayer;
		cout << "Layer " << i << endl;
		for (j = 0; j < layer[i]->numNeurons;i++) {
			layer[i]->neurons[j]->weights = new double[numNeuronsLayer];
			layer[i]->neurons[j]->layer = j;
			cout << "	Neuron " << j << endl;
			for (k=0;k<numNeuronsLayer;k++){
				layer[i]->neurons[j]->weights[k] = 1/Zufallszahl(0,10);
				cout << "		Weight " << k << ": " << layer[i]->neurons[j]->weights[k];
			}
		}
	}


}

double Zufallszahl(int lorange, int hirange) 
{
	time_t t;

    time(&t);
    srand((unsigned int)t); 
	return rand() % hirange + lorange;
}