samedi 29 octobre 2016

Is there a better method than using Map?

I am creating a genetic algorithm that classifies set of data for which I need to generate random sequences of 1s,0s and 2s for defining a rule 2 represents it being in 2 states a 1 and 0. I am trying to use Map STL for mapping the random set of rules generated and the output for each rule. I need the Map key to be dynamic/ changing ever iteration to be filled by new population of rules.

I realise I have option of using pointers which complicates my code and will have readability issue.

The other option I know about is copy the key element and deleting it so it can be replace by the new rule.

So, My question is:

1). Is it better to use vector and my own mapping algorithm? The only problem being is I want to be efficient and fast as I will be dealing with 2000 or more data.

2). Are there any other STL which I can use no libraries that I need to download pls.?

3). Shall I just use Map and keep reseting the elements in the map each time so I can initialise them again?

which method would be effective?

Open to any other suggestion or advice.

Aucun commentaire:

Enregistrer un commentaire