September 24th, 2013, 03:48 PM
Newbie problem - can I use a string to set a parameter?
Private Sub Neuron1x2_Click_1(sender As Object, e As EventArgs) Handles Neuron1x2.Click
If NEURON(1, 2) = 1 Then NEURON(1, 2) = 0 Else NEURON(1, 2) = 1
If NEURON(1, 2) = 1 Then Neuron1x2.BackColor = Color.Red
If NEURON(1, 2) = 0 Then Neuron1x2.BackColor = Color.White
I am trying to develop a simple, visual neural network. I need this to demonstrate principles to students (I teach psychology)
The 'neurons' are represented by successive rows of ovals on the screen, and are connected (up and down) by lines (the 'axons').
When the user triggers an event, then the system will run down the rows in succession, checking if an input (incoming axon) is active,
then summing them for each 'neuron' and comparing with a threshold to see if the neuron should then become active.
I want the user to be able to set the initial state of the network, by clicking on the neurons, which then become red - as above.
I want to set the overall system as a two dimensional array, using DIM (x, y), and will then use this to successively run across each row (using y),
and down each layer (using x).
I have a very limited knowledge of programming (some early basic and assembler), and am having some difficulty.
My main problem at the moment is how to change the color, using the array values.
I am able to use the array values to generate a string (by converting the numbers x and y to strings, then combing them with "Neuron" and "x")
- for example "Neuron1x2" , but is there any way to use this in the expression?
Neuron1x2.BackColor = Color.Red
I appreciate I may be doing this all in completely the wrong way, and/or that this may not be possible.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!