1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
// AI.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <vector>
const int num_inputs = 20;
int inputs[num_inputs];
using namespace std;
class neuron {
neuron *inputs[100];
public:
int val[100];
public:
void GetArrInput(int arr[]) {
for (int i = 0; i < sizeof(arr[0]) / sizeof(arr); i++) {
val[i] = arr[i];
}
}
void GetInputs() {
int j = 0;
for (int i = 0; i < sizeof(inputs) / sizeof(inputs[0]); i++) {
while (j<10) {
val[i] = inputs[i]->output[j];
j++;
}
}
}
void Process() {
}
int output[10];
};
class brain {
public:
vector<neuron> neurons;
void CreateBrain(int arr[]) {
int aray[sizeof(arr[0]) / sizeof(arr)];
for (int i = 0; i < sizeof(arr[0]) / sizeof(arr); i++) {
aray[i] = arr[i];
}
for (int i = 0; i < sizeof(inputs[0]) / sizeof(inputs); i++) {
neurons.push_back(neuron());
}
neurons[0].GetArrInput(aray);
}
void ShowNeuron() {
for (int i = 0; i<10; i++) {
cout << neurons[0].val[i] << endl;
}
}
};
int main()
{
int arr[100] = {
1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10,
};
brain tom;
tom.CreateBrain(arr);
tom.ShowNeuron();
system("pause");
return 0;
}
| |