public UnsureNetworkForm() { InitializeComponent(); NodeSavingReading reader = new NodeSavingReading(); net = new NeuralNet(7, 7, ANNfilename, KFoldFilename); inputTrainingData = reader.GetStoredDataFromFile(Globals.inputDataStorage); outputTrainingData = reader.GetStoredDataFromFile(Globals.outputDataStorage); //inputTrainingData = new List<double[]>(); //outputTrainingData = new List<double[]>(); controls = new PatsControlScheme(); controls.Initialize(); controls.timeNeededForChange = 7000; serial = new SerialReader(); serial.Read(); UnityCommunicationHub.InitializeUnityCommunication(); UnityCommunicationHub.TwoWayTransmission(); indexList = Globals.GetBasicValues(); reverseIndexList = Globals.GetBasicValuesReversed(); setPointList = Globals.GetBasicPositions(); foreach (KeyValuePair <string, int> position in indexList) { DefaultPositionsBox.Items.Add(position.Key); } }
public NeuralNetForm() { InitializeComponent(); NodeSavingReading reader = new NodeSavingReading(); net = new NeuralNet(8, 7, ANNfilename, KFoldFilename); inputTrainingData = reader.GetStoredDataFromFile(Globals.inputDataStorage); outputTrainingData = reader.GetStoredDataFromFile(Globals.outputDataStorage); //inputTrainingData = new List<double[]>(); //outputTrainingData = new List<double[]>(); serial = new SerialReader(); serial.Read(); UnityCommunicationHub.InitializeUnityCommunication(); UnityCommunicationHub.TwoWayTransmission(); indexList = Globals.GetBasicValues(); setPointList = Globals.GetBasicPositions(); foreach (KeyValuePair <string, int> position in indexList) { DefaultPositionsBox.Items.Add(position.Key); } }
public ContinuousNeuralNetForm() { InitializeComponent(); net = new NeuralNet(8, 7, ANNfilename, KFoldFilename); inputTrainingData = new List <double[]>(); outputTrainingData = new List <double[]>(); if (inputTrainingData.Count > expirationTimer) { inputTrainingData.RemoveAt(0); outputTrainingData.RemoveAt(0); } serial = new SerialReader(); serial.Read(); UnityCommunicationHub.InitializeUnityCommunication(); UnityCommunicationHub.TwoWayTransmission(); Random rand = new Random(23); setPointList = Globals.GetBasicPositions(); var firstPoint = setPointList[3]; Globals.A1DesiredPosition = firstPoint.A1Position; Globals.A2DesiredPosition = firstPoint.A2Position; Globals.A3DesiredPosition = firstPoint.A3Position; Globals.B1DesiredPosition = firstPoint.B1Position; Globals.B2DesiredPosition = firstPoint.B2Position; Globals.B3DesiredPosition = firstPoint.B3Position; Globals.C1DesiredPosition = firstPoint.C1Position; Globals.C2DesiredPosition = firstPoint.C2Position; Globals.C3DesiredPosition = firstPoint.C3Position; Globals.D1DesiredPosition = firstPoint.D1Position; Globals.D2DesiredPosition = firstPoint.D2Position; Globals.D3DesiredPosition = firstPoint.D3Position; Globals.T1DesiredPosition = firstPoint.T1Position; Globals.T2DesiredPosition = firstPoint.T2Position; //Globals.T1DesiredPosition = (float)rand.Next(0, 90); //Globals.T2DesiredPosition = (float)rand.Next(0, 90); //Globals.A1DesiredPosition = (float)rand.Next(0, 90); //Globals.A2DesiredPosition = (float)rand.Next(0, 90); //Globals.A3DesiredPosition = (float)rand.Next(0, 90); //Globals.B1DesiredPosition = (float)rand.Next(0, 90); //Globals.B2DesiredPosition = (float)rand.Next(0, 90); //Globals.B3DesiredPosition = (float)rand.Next(0, 90); //Globals.C1DesiredPosition = (float)rand.Next(0, 90); //Globals.C2DesiredPosition = (float)rand.Next(0, 90); //Globals.C3DesiredPosition = (float)rand.Next(0, 90); //Globals.D1DesiredPosition = (float)rand.Next(0, 90); //Globals.D2DesiredPosition = (float)rand.Next(0, 90); //Globals.D3DesiredPosition = (float)rand.Next(0, 90); lastSetPoint = firstPoint; UnityCommunicationHub.WriteData(true); }
public Form1() { this.FormClosing += Globals.CloseAllForms; //Initializes Serial Reader serialReader = new SerialReader(); InitializeComponent(); form = new Form2(); form.Show(); }