Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexicase survival #23

Merged
merged 9 commits into from Aug 2, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions few/lib/epsilon_lexicase.h
Expand Up @@ -96,9 +96,8 @@ void epsilon_lexicase(const ExtMat & F, int n, int d,
for (int i = 0; i<epsilon.size(); ++i)
epsilon(i) = mad(F.col(i));

vector<int> ind_locs(n);
if(lex_size){
char message[200];
vector<int> ind_locs(n);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ind_locs should start out empty if you are pushing back values into it. otherwise it will be 2n after lex_size.

Copy link
Collaborator Author

@rgupta90 rgupta90 Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I also thought so, but it was showing an error with just declaring it above vector ind_locs and then reserving size inside else statement(when lex_size is not there). And if I just declare and define inside else, it may not be accessible outside.
In case this is 2n after lex_size and is an issue, will have to see an alternative.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ind_locs.resize(n); should work.

if(lex_size){
//randomly select a size from sizes
int max_index = sizes.size();
int random_index = rand() % max_index;
Expand Down