Skip to content

Commit

Permalink
Cleanup warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
emilydolson committed Jul 3, 2018
1 parent e724c35 commit 38d6ab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions source/Evolve/World_select.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ namespace emp {

// @CAO: Can probably optimize a bit!

std::map<typename ORG::genome_t, int> genotype_counts;
std::map<typename ORG::genome_t, size_t> genotype_counts;
emp::vector<emp::vector<size_t>> genotype_lists;

// Find all orgs with same genotype - we can dramatically reduce
Expand Down Expand Up @@ -213,7 +213,7 @@ namespace emp {
for (size_t fit_id = 0; fit_id < fit_funs.size(); ++fit_id) {
fitnesses[fit_id].resize(genotype_counts.size());
// std::cout << fit_id << std::endl;
int id = 0;
size_t id = 0;
for (auto & gen : genotype_lists) {
fitnesses[fit_id][id] = fit_funs[fit_id](world.GetOrg(gen[0]));
id++;
Expand Down Expand Up @@ -290,12 +290,12 @@ namespace emp {
}
emp_assert(repro_id != -1, repro_id, winner, options);

// std::cout << depth << "abotu to calc used" <<std::endl;
emp::vector<size_t> used = Slice(order, 0, depth+1);
// std::cout << depth << "about to calc used" <<std::endl;
emp::vector<size_t> used = Slice(order, 0, (size_t)depth+1);
// If the world has a OnLexicaseSelect method, call it
// std::cout << depth << " " << to_string(used) << std::endl;
TriggerOnLexicaseSelect(world, used, repro_id);
world.DoBirth( world.GetGenomeAt(repro_id), repro_id );
world.DoBirth( world.GetGenomeAt((size_t)repro_id), (size_t)repro_id );
}
// std::cout << "Done with lex" << std::endl;
}
Expand Down
8 changes: 4 additions & 4 deletions source/tools/vector_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ namespace emp {
/// Returns a vector containing a chunk of elements from @param vec
/// starting at @param start and going up to but not including @param stop.
template <typename T>
emp::vector<T> Slice(emp::vector<T> vec, int start, int stop) {
emp::vector<T> Slice(emp::vector<T> vec, size_t start, size_t stop) {
emp_assert(start < stop, start, stop);
emp_assert(start < (int)vec.size(), start, vec.size());
emp_assert(stop <= (int)vec.size(), stop, vec.size());
emp_assert(start < vec.size(), start, vec.size());
emp_assert(stop <= vec.size(), stop, vec.size());

emp::vector<T> new_vec;
for (int i = start; i < stop; i++){
for (size_t i = start; i < stop; i++){
new_vec.push_back(vec[i]);
}
return new_vec;
Expand Down

0 comments on commit 38d6ab1

Please sign in to comment.