graphhopper / jsprit

jsprit is a java based, open source toolkit for solving rich vehicle routing problems
https://www.graphhopper.com/open-source/
Apache License 2.0
1.63k stars 604 forks source link

Skills added by addSkill and addAllSkillls may not match #165

Closed syonekura closed 9 years ago

syonekura commented 9 years ago

Hi, fist of all, I found this library a week ago and it has been so useful and easy to use, so many thanks to the developers for their great job

I found this little bug when solving a VRPTW, in my case, I added the required skills to my services using addSkill, and then used addAllSkills on the vehicles, causing to get all the jobs unassigned, so i think addAllSkills should call toLowerCase as addSkill does, or call addSkill within the for loop:

public Builder addAllSkills(Collection<String> skills){
            for(String skill : skills) this.skills.add(skill);
            return this;
        }

public Builder addSkill(String skill){
            skills.add(skill.toLowerCase());
            return this;
        }
oblonski commented 9 years ago

Thanks @syonekura for your kind words and the bug detection.