Forum: C++ Dec 6th, 2008 |
| Replies: 1 Views: 287 im trying to show what is stored in arrays, basically to make sure my program is working fine, i have got it to print which element in the array it is, but how do u access the array and show what... |
Forum: C++ Dec 5th, 2008 |
| Replies: 8 Views: 380 i just want it to choose a random number between 0 and 7 basically knowing the code for that would really help,
i am the author of that code, but there are parts that are taken from the lecturers... |
Forum: C++ Dec 5th, 2008 |
| Replies: 8 Views: 380 so would the correct way to write it be rand()(8); ?
im just confused to how the brackets and such work with this particular instruction |
Forum: C++ Dec 5th, 2008 |
| Replies: 8 Views: 380 I dont understand why there are arguments with it. and they have to be random as they are randomly selected - the point of the program is there is a random element to almost everything being chosen.... |
Forum: C++ Dec 5th, 2008 |
| Replies: 8 Views: 380 basically here is my code, sorry if its untidy. you will see in the crossover function i want to use the rand. i get errors like "too many arguments for int rand()"
#include <iostream.h>... |
Forum: C++ Nov 26th, 2008 |
| Replies: 3 Views: 792 i have an array of 16 things, now 8 of them have to be chosen at random so basically what i want to do is
random(CHR/2)
like choose a random number from CHR/2 (as there are 8 not 16 now)
... |
Forum: C++ Nov 22nd, 2008 |
| Replies: 10 Views: 773 that is exactly what i want to do. thank you so much, and for putting it into such clear language, i really appreciate it!!!
if i have more problems with this ill probably start a new thread as... |
Forum: C++ Nov 21st, 2008 |
| Replies: 10 Views: 773 cheers that helps a bit,
basically what your doing is calling one of the elements in error the lowest until something else comes along which is lower, so basically adding on a number to each one... |
Forum: C++ Nov 20th, 2008 |
| Replies: 10 Views: 773 could you please explain how this works, like im more dumbed down, i can kinda see how it would work, but if u could just run through it in words or something that would be grately appreciated |
Forum: C++ Nov 20th, 2008 |
| Replies: 10 Views: 773 sorry i have been looking at code solid for the last few days so my brain is wasted!
right the 16 rows in the weights array all have a fitness rating or error, which is stored in the array error
... |
Forum: C++ Nov 20th, 2008 |
| Replies: 10 Views: 773 i have an array
weights[16][60]
this being 16 rows of 60 elements in each one
i have another
error[16] |
Forum: C++ Nov 19th, 2008 |
| Replies: 1 Views: 242 this is my sub proceedure
/******************************************************************************
*
* Name: patpixselect
* Parameters: none
* Returns: patpix[]
* Globals: none
... |
Forum: C++ Nov 19th, 2008 |
| Replies: 2 Views: 261 i have an array
weights[16][60]
16 rows of 60 columns
if you are changing indiviual elements it goes from weights[0][0] to weights[15][59] right?
see if im using them in a loop |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 612 can you do calculations with individual cells
e.g. like array[1][2] * array[1][3], will that work |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 612 is there a way in 2-D arrays to overwrite or change full rows if array[row][col]
is that the same as the loops from earlier only doing the loop for one dimension? |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 612 i know how to give each one random numbers, if i went
myarray[0][1] = code for random number;
.
.
.
.
.
.
. |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 612 sorry if this a bit of a pain and there are other threads to read about this but can anyone explain how arrays work a bit, i need a quick refresher course.
like how they work, are they like the... |
Forum: C++ Mar 31st, 2008 |
| Replies: 3 Views: 429 would this work.
if ( pattern1 || pattern2 == 1 )
does this mean that if either pattern1 or pattern2 is 1 then it will do what comes in that set of brackets.
because ive done this |
Forum: C++ Mar 31st, 2008 |
| Replies: 3 Views: 429 i know that the AND command is && but what are the code for OR? also if i have a program looping through a system and i want to add something to a variable each time through would
ERRORtotal +=... |
Forum: C++ Mar 26th, 2008 |
| Replies: 6 Views: 554 thanks, erm im not sure how to set it up with arrays. could you give me and example with some of my variables and that should help me set it up. is there any other way around this? is there a way... |
Forum: C++ Mar 25th, 2008 |
| Replies: 6 Views: 554 here is my full program, sorry that my comments and stuff may be wrong, the first function basically runs through and corrects the variables so that the errors are less than a certain amount, then i... |
Forum: C++ Mar 25th, 2008 |
| Replies: 6 Views: 554 it gives me errors saying that each variable hasnt been declared. but when i declare them at the start of the next function it just overwrites them with other values. so im a bit stuck.
void... |
Forum: C++ Mar 25th, 2008 |
| Replies: 6 Views: 554 im starting a sub proceedure to test program once its worked through earlier processes. however to test the program, i have copied and pasted pieces of the program before hand, and because ive used... |
Forum: C++ Mar 22nd, 2008 |
| Replies: 1 Views: 501 i have a do while loop in my program. im just unsure of how to make it work.
i need it to continue doing the loop until the error is between -0.1 and 0.1
i have this so far, i may have the... |
Forum: C++ Mar 20th, 2008 |
| Replies: 1 Views: 4,723 i have a formula, it is basically the result of two other previous calculations and it gives me an eror message saying that i cant use it as a function
ERRORC = (( target1 ) - ( OUTC )... |
Forum: C++ Mar 20th, 2008 |
| Replies: 7 Views: 429 it wont allow me to use ( target1 - OUTC ) as a function, why would that be? |
Forum: C++ Mar 20th, 2008 |
| Replies: 7 Views: 429 oh god, that was soo trivial, i should have known better, god this is a little frustrating. anyway thanks again for ur help. no doubt ull here from me soon |
Forum: C++ Mar 20th, 2008 |
| Replies: 7 Views: 429 this is a screen dump
please select which pattern: 1
target 1 is: -1.#QNAN
target 2 is: 9.79083e+027
please select each pixel in the pattern:
pixel1: |
Forum: C++ Mar 20th, 2008 |
| Replies: 7 Views: 429 firstly id like to thank people for helping me with my earlier problems.
anyway, for this program im working on, i want the user to be able to select between two patterns.
eg. pattern1 makes x=1... |
Forum: C++ Mar 20th, 2008 |
| Replies: 8 Views: 448 thanks bud, thats perfect, i dont think ill use it til the end so i can use the numbers to calculate the outcomes by hand too. anyway thanks so much. ill be asking another question soon, but not on... |
Forum: C++ Mar 20th, 2008 |
| Replies: 8 Views: 448 i dont quite understand, but thats purely down to my knowledge of c++ i really am a beginner so sorry and i thank you for your patience, basically my system runs through and stops, i exit the console... |
Forum: C++ Mar 20th, 2008 |
| Replies: 8 Views: 448 thank you, helped lots, i just assumed that there was a symbol for the natural exponential in c++.
i am also creating random numbers for each weight.
float W1A = -1 + rand() / (... |
Forum: C++ Mar 19th, 2008 |
| Replies: 8 Views: 448 exp is meant to represent the natural exponential, is how it is represented in every other electronic form ive met, i just assumed c++ would be the same, how would i incorporate this pow() in the... |
Forum: C++ Mar 19th, 2008 |
| Replies: 8 Views: 448 this isnt working, i think it has something to do with the natural exponential, its a calculation of the sigmoid function. it basically should read
1/(1 + e^-((W1A*pix1)+(W2A*pix2)))
this is... |
Forum: C++ Mar 18th, 2008 |
| Replies: 7 Views: 536 actually ill just put the code up. this is only the start of it, with one or two of the calculations. only on of the variables ive tried to make random, so if u want have a look and see what im... |
Forum: C++ Mar 18th, 2008 |
| Replies: 7 Views: 536 thanks bud. and its ok, since i aint very good at this my questions may seem a bit ambigious. thanks for your help tho, its very much appreciated.
the exp seems like it will work now, thanks on... |
Forum: C++ Mar 18th, 2008 |
| Replies: 7 Views: 536 thanks, but is there not a way to just have a random number for each variable, with just one line?
is there a way to make the code i showed work how i want?
also im not sure that your example... |
Forum: C++ Mar 18th, 2008 |
| Replies: 7 Views: 536 thanks for your help,
i dont want spoon fed but could you give me an example of how the "pow" command would be used.
also is this a correct use of the random command to create a random number... |
Forum: C++ Mar 18th, 2008 |
| Replies: 7 Views: 536 hey there guys. this im officially my first post on this forum. seems pretty impressive how much there is on offer, however its only C++ im looking for assistance with today.
i have two questions.... |