easy questoin

i have a multibody called wolf. i want the controller class to get some data from the wolf class so within wolf i have

+ to returndis:
return dis.

then i try to call it from the controller class like this.

Cdis    =(Wolf returndis).

it says it cannot find Wolf. i know i can send the data by two functoins in both . ie in wolf use a command like "controller givedis to value dis" then in the controller class have a functoin like " + to givedis to value Cdis" but this gets complicated with many varibles and i know there must be a easyer way. i tryed to make it so there has to be a wolf already created but it still says cannot find wolf. any help would be great , thanks.

easy questoin

It should work the way you have it, unless there is a problem with your declaration of Wolf. It's hard to tell what the problem is without seeing the rest of your code -- please post it here.

- jon

easy questoin

unfortantly i dont think i can really upload code for everyone to see as its part of my final project for uni. But i asked my tutor and he said i could e-mail it to you if i comment your involvement.but ive got around that perticular problem by making a list and then using a foreach loop.but i also think theres something not quite right in the physics engine of breve.

basicly ive created a multibody. i then create some lists of random numbers to use in sinwave equatoins for the multibody. i then test them all , after this i find the five best random number groups and mutate them to create a new set of lists BUT i still keep the 5 best lists unaltered and they get tested in the next round again , this is ment so if a better solutoin is not found in the next round it wont lose a good solutoin from the last round. although when they are tested again they do not repeat there performance. i have altered and realtered much of my code to try and find the problem. ive checked that the lists are not being altered etc etc. the only possible concultoin i can find is that the physics is not reacting the same way each time i have even altered some time varibles so they will be consistent with the first round and each trial.

i understand this probably would not be soo noticeable in the walking genetic algorythems used in the breve demo's but I do think there is a slight problem there somewhere. if you do or do not wish for me to e-mail my code to you could you please respond so i know my optoins. thankyou so much
Noz

easy questoin

In this line of code you posted:
Cdis =(Wolf returndis).

Is Wolf the name of an instance or the name of the class? If it is the latter, then it won't work because you need an instance. When you use (controller do-something) you are using an automatically generated instance of your Controller class, but otherwise you need to create your own instances.

If Wolf is indeed an instance in that line, may I suggest you follow the common naming conventions, and name your classes starting with uppercase and your variables/instances with lowercase? That helps avoiding confusions when other people read your code. :wink:

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.