Examples of AntAlgorithmSettings


Examples of com.chkris.ant.model.AntAlgorithmSettings

@Service
public class AntAlgorithmSettingsBuilder {

    public AntAlgorithmSettings buildFromRequest(String request) {
        AntAlgorithmSettings antAlgorithmSettings = new AntAlgorithmSettings();

        ObjectMapper mapper = new ObjectMapper();

        try {
            JsonNode antAlgorithmSettingsJsonNode = mapper.readTree(request).get("antAlgorithmSettings");

            antAlgorithmSettings
                .setAlpha(antAlgorithmSettingsJsonNode.get("alpha").getValueAsDouble())
                .setBeta(antAlgorithmSettingsJsonNode.get("beta").getValueAsDouble())
                .setInitialPheromoneAmount(antAlgorithmSettingsJsonNode.get("initialPheromoneAmount").getValueAsInt())
                .setMaximalNumberOfAnts(antAlgorithmSettingsJsonNode.get("maximalNumberOfAnts").getValueAsInt())
                .setMaximalNumberOfIterations(antAlgorithmSettingsJsonNode.get("maximalNumberOfIterations").getValueAsInt())
View Full Code Here

Examples of com.chkris.ant.model.AntAlgorithmSettings

    @RequestMapping(method = RequestMethod.POST, value="/city", consumes = "application/json")
    @ResponseBody
    public String processSubmitCreateClient(@RequestBody String request) throws Exception {

        AntAlgorithmSettings antAlgorithmSettings = this.antAlgorithmSettingsBuilder.buildFromRequest(request);

        this.antService.setGraph(this.graphBuilder.build(request, antAlgorithmSettings));
        this.antService.setCount(0);
        this.antService.setAntAlgorithmSettings(antAlgorithmSettings);
        return antAlgorithmSettings.toString();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.