|
Won't start a new thread but hopefully i can get some answers. I've had some help from a friend for the first bit of pseudo code i posted and nearly finished that but im still struggling with this one:
1) We need to add a For loop that iterates for the specified number of iterations.
2) We need to create an initial random solution of size n.
3) We need to evaluate the fitness of our current solution within the loop.
4) We need to copy the current solution (say oldsol).
5) We make a small change to the current solution and evaluate the fitness to another variable.
6) If the new fitness is worse than the old, we copy oldsol back to being our current solution.
7) After the For loop has completed we return the current solution.
The reason for this is because i don't know what the code is asking me to do. I know for some bits but it would be really helpful if you guys could indicate to me what each step is asking me to do. That way it's up to me to go and do the research and implement it myself.
I realised that when doing the first psuedo code i only needed someone to tell me what its asking me to do and then i did it myself. For example steps 2 and 3 on this one; what function/method should i be using for that? I really just need to know what methods need to be implemented and then i'll go off do the research and hopefully learn something by doing so.
|