Package jsprit.core.problem

Examples of jsprit.core.problem.Skills


    }

    @Override
    public void visit(TourActivity activity) {
        if(activity instanceof TourActivity.JobActivity){
            Skills skills = ((TourActivity.JobActivity) activity).getJob().getRequiredSkills();
            skillBuilder.addAllSkills(skills.values());
        }
    }
View Full Code Here


        }
    }

    @Override
    public void finish() {
        Skills skills = skillBuilder.build();
        statesManager.putTypedInternalRouteState(route, InternalStates.SKILLS, skills);
    }
View Full Code Here

        stateManager.informInsertionStarts(Arrays.asList(route),null);
    }

    @Test
    public void whenUpdatingRoute_skillsAtRouteLevelShouldContainAllSkills(){
        Skills skills = stateManager.getRouteState(route, InternalStates.SKILLS, Skills.class);
        assertNotNull(skills);
        Assert.assertEquals(5,skills.values().size());
        assertTrue(skills.containsSkill("skill1"));
        assertTrue(skills.containsSkill("skill2"));
        assertTrue(skills.containsSkill("skill3"));
        assertTrue(skills.containsSkill("skill4"));
        assertTrue(skills.containsSkill("skill5"));
    }
View Full Code Here

        try {
            Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
            VehicleRoutingProblemSolution solution = Solutions.bestOf(solutions);
            assertEquals(828.94, solution.getCost(), 0.01);
            for(VehicleRoute route : solution.getRoutes()){
                Skills vehicleSkill = route.getVehicle().getSkills();
                for(Job job : route.getTourActivities().getJobs()){
                    for(String skill : job.getRequiredSkills().values()){
                        if(!vehicleSkill.containsSkill(skill)){
                            assertFalse(true);
                        }
                    }
                }
            }
View Full Code Here

        for(String skill : insertionContext.getJob().getRequiredSkills().values()){
            if(!insertionContext.getNewVehicle().getSkills().containsSkill(skill)){
                return false;
            }
        }
        Skills requiredSkillsForRoute = states.getRouteState(insertionContext.getRoute(), InternalStates.SKILLS, Skills.class);
        if(requiredSkillsForRoute == null) requiredSkillsForRoute = defaultSkills;
        for(String skill : requiredSkillsForRoute.values()){
            if(!insertionContext.getNewVehicle().getSkills().containsSkill(skill)){
                return false;
            }
        }
        return true;
View Full Code Here

TOP

Related Classes of jsprit.core.problem.Skills

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.