You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by AhmedAlaa333 <ah...@gmail.com> on 2015/10/28 10:33:10 UTC

Apache Camel Optaplanner Component

Hello,

I tried to change the "OptaPlannerSyncSolverTest" function to solve Vehicle
Routing Problem instead of CloudBalancing

CloudBalance:
       CloudBalancingGenerator generator = new
CloudBalancingGenerator(true);
        final CloudBalance planningProblem = generator.createCloudBalance(4,
12);
        assertNull(planningProblem.getScore());
        assertNull(planningProblem.getProcessList().get(0).getComputer());

        CloudBalance bestSolution = (CloudBalance)
template.requestBody("direct:in", planningProblem);

        assertEquals(4, bestSolution.getComputerList().size());
        assertEquals(12, bestSolution.getProcessList().size());
        assertNotNull(bestSolution.getScore());
        assertTrue(bestSolution.getScore().isFeasible());
        assertNotNull(bestSolution.getProcessList().get(0).getComputer());

My Code:
        VehicleRoutingImporter Importer = new VehicleRoutingImporter(true);
        File inputFile1 = new File(file);
        VehicleRoutingSolution unsolvedCloudBalance =
(VehicleRoutingSolution) Importer.readSolution(inputFile1);
        VehicleRoutingSolution solvedCloudBalance = (VehicleRoutingSolution)
template.requestBody("direct:in", unsolvedCloudBalance);

It crashes within the last line, it's CastingError Exception...any idea why?

Thanks 



--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-Optaplanner-Component-tp5773140.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Apache Camel Optaplanner Component

Posted by Bilgin Ibryam <bi...@gmail.com>.
Can you add here the full exception message pls.

On 28 October 2015 at 09:33, AhmedAlaa333 <ah...@gmail.com> wrote:

> Hello,
>
> I tried to change the "OptaPlannerSyncSolverTest" function to solve Vehicle
> Routing Problem instead of CloudBalancing
>
> CloudBalance:
>        CloudBalancingGenerator generator = new
> CloudBalancingGenerator(true);
>         final CloudBalance planningProblem =
> generator.createCloudBalance(4,
> 12);
>         assertNull(planningProblem.getScore());
>         assertNull(planningProblem.getProcessList().get(0).getComputer());
>
>         CloudBalance bestSolution = (CloudBalance)
> template.requestBody("direct:in", planningProblem);
>
>         assertEquals(4, bestSolution.getComputerList().size());
>         assertEquals(12, bestSolution.getProcessList().size());
>         assertNotNull(bestSolution.getScore());
>         assertTrue(bestSolution.getScore().isFeasible());
>         assertNotNull(bestSolution.getProcessList().get(0).getComputer());
>
> My Code:
>         VehicleRoutingImporter Importer = new VehicleRoutingImporter(true);
>         File inputFile1 = new File(file);
>         VehicleRoutingSolution unsolvedCloudBalance =
> (VehicleRoutingSolution) Importer.readSolution(inputFile1);
>         VehicleRoutingSolution solvedCloudBalance =
> (VehicleRoutingSolution)
> template.requestBody("direct:in", unsolvedCloudBalance);
>
> It crashes within the last line, it's CastingError Exception...any idea
> why?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Apache-Camel-Optaplanner-Component-tp5773140.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam <https://twitter.com/bibryam>

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475