Examples of MARBFastEnvironment


Examples of eas.users.lukas.marbImplicitEvolution.simpleMazeEnvironment.MARBFastEnvironment

                    -exponent);
        }

        System.out.println(wkeitsMatrix);
       
        MARBFastEnvironment env = new MARBFastEnvironment(0, params, false);
        JasmineRobotWithoutMutationMatrixSelection agent;
        MARBBrain<AbstractAgent2D<?>> brain;
        Random rand = new Random(params.getSeed());
        String gutesGenom = "001, 003, 003, 001, 000, 012, 004, 196, 000, 015, 000, 012, 007, 135, 000, 006, 000, 010, 000, 000, 001, 001, 000, 012, 001, 191, 000, 004, 000, 012, 001, 032, 000, 005, 000, 012, 003, 073, 000, 015, 000, 011, 000, 012, 004, 170, 000, 016, 000, 010, 000, 010, 000, 000, 005, 001, 000, 012, 004, 000, 012, 007, 000, 015, 000, 012, 001, 073, 000, 008, 000, 011, 000, 000, 011, 001, 000, 000, 000, 015, 003, 003, 001, 000, 000, 000, 011, 004, 001, 001, 000, 012, 006, 031, 000, 008, 000, 000, 022, 001, 000, 000, 000, 026, 003, 005, 001, 000, 000, 000, 010, 002, 005, 001, 000, 000, 000, 009, 003, 004, 001, 000, 012, 006, 108, 000, 009, 000, 012, 004, 140, 000, 016, 000, 010, 000, 012, 006, 125, 000, 008, 000, 011, 000, 000, 010, 001, 000, 012, 001, 092, 000, 016, 000, 012, 003, 113, 000, 016, 000, 012, 001, 017, 000, 015, 000, 012, 003, 000, 012, 001, 000, 008, 000, 011, 000, 010, 000, 010, 000, 000, 006, 001, 000, 012, 001, 163, 000, 009, 000, 012, 003, 000, 012, 001, 000, 015, 000, 010, 000, 000, 015, 001, 000, 012, 002, 013, 000, 016, 000, 012, 005, 091, 000, 006, 000, 010, 000, 000, 011, 001, 000, 000, 000, 022, 004, 005, 001, 000, 012, 003, 140, 000, 009, 000, 012, 007, 098, 000, 009, 000, 010, 000, 012, 001, 071, 000, 008, 000, 012, 007, 210, 000, 008, 000, 011, 000, 010, 000, 000, 015, 001, 000, 000, 000, 006, 005, 003, 001, 000, 012, 006, 045, 000, 015, 000, 000, 011, 001, 000, 000, 000, 005, 005, 009, 001, 000, 012, 006, 158, 000, 015, 000, 012, 006, 132, 000, 009, 000, 012, 004, 080, 000, 009, 000, 012, 002, 000, 012, 005, 000, 016, 000, 010, 000, 011, 000, 011, 000, 000, 006, 001, 000, 012, 003, 247, 000, 008, 000, 012, 004, 089, 000, 008, 000, 011, 000, 000, 009, 001, 000, 012, 005, 253, 000, 016, 000, 000, 004, 001, 000, 012, 005, 095, 000, 009, 000, 012, 006, 045, 000, 009, 000, 010, 000, 000, 019, 001, 000, 012, 005, 081, 000, 015, 000, 012, 005, 213, 000, 009, 000, 010, 000, 000, 026, 001, 000, 012, 007, 000, 012, 005, 000, 015, 000, 000, 011, 001, 000, 000, 000, 004, 005, 003, 001, 000, 000, 000, 019, 005, 001, 001, 000, 012, 007, 000, 012, 002, 000, 015, 000, 000, 002, 001, 000, 000, 000, 002, 005, 004, 001, 000, 012, 006, 143, 000, 008, 000, 012, 007, 199, 000, 015, 000, 011, 000, 000, 002, 001, 000, 000, 000";
        String schlechtesGenom = "001, 003, 001, 001, 000, 013, 000, 000, 002, 001, 000, 000, 000, 002, 004, 001, 001, 000, 000, 000";
        Vector2D pos;
        double richt;
       
        if (numGoodAgents < 1) {
            numGoodAgents = 1;
        }
        if (numBadAgents < 1) {
            numBadAgents = 1;
        }
       
        Rectangle2D bound = new Rectangle2D(env.getBoundingBox(false));
       
        double puffer = 100;
        bound.setLeft(bound.upperLeftCorner().x + puffer);
        bound.setRight(bound.lowerRightCorner().x - puffer);
        bound.setTop(bound.upperLeftCorner().y + puffer);
        bound.setBottom(bound.lowerRightCorner().y - puffer);
       
        for (int j = 0; j < numGoodAgents; j++) {
            agent = new JasmineRobotWithoutMutationMatrixSelection(
                    j,
                    env,
                    rand,
                    params,
                    true,
                    360,
                    gutesGenom,
                    schlechtesGenom,
                    wkeitsMatrix);
            brain = new MARBBrain<AbstractAgent2D<?>>(
                    agent,
                    gutesGenom,
                    params);
            agent.implantBrain(brain);

            pos = new Vector2D(
                    rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                    rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            richt = rand.nextDouble() * 360;
           
            while (!env.addCollidingAgent(
                    agent,
                    pos, richt)) {
                pos = new Vector2D(
                        rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                        rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            }
           
        }

        for (int j = 0; j < numBadAgents; j++) {
            agent = new JasmineRobotWithoutMutationMatrixSelection(
                    j,
                    env,
                    rand,
                    params,
                    true,
                    360,
                    gutesGenom,
                    schlechtesGenom,
                    wkeitsMatrix);
            brain = new MARBBrain<AbstractAgent2D<?>>(
                    agent,
                    schlechtesGenom,
                    params);
            agent.implantBrain(brain);

            pos = new Vector2D(
                    rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                    rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            richt = rand.nextDouble() * 360;
           
            while (!env.addCollidingAgent(
                    agent,
                    pos, richt)) {
                pos = new Vector2D(
                        rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                        rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            }
           
        }
       
        env.getJasmineAgents();
       
        return new MARBFastEnvironment[] { env };
    }
View Full Code Here

Examples of eas.users.lukas.marbImplicitEvolution.simpleMazeEnvironment.MARBFastEnvironment

    @Override
    public MARBFastEnvironment[] generateRunnables(ParCollection params) {
        int numGoodAgents = (int) params.getParValueVector2D("NumberOfAgents").x;
        int numBadAgents = (int) params.getParValueVector2D("NumberOfAgents").y;
       
        MARBFastEnvironment env = new MARBFastEnvironment(0, params, false);
        JasmineRobotWithoutMutationRegularSelection agent;
        MARBBrain<AbstractAgent2D<?>> brain;
        Random rand = new Random(params.getSeed());
        String gutesGenom = "001, 003, 003, 001, 000, 012, 004, 196, 000, 015, 000, 012, 007, 135, 000, 006, 000, 010, 000, 000, 001, 001, 000, 012, 001, 191, 000, 004, 000, 012, 001, 032, 000, 005, 000, 012, 003, 073, 000, 015, 000, 011, 000, 012, 004, 170, 000, 016, 000, 010, 000, 010, 000, 000, 005, 001, 000, 012, 004, 000, 012, 007, 000, 015, 000, 012, 001, 073, 000, 008, 000, 011, 000, 000, 011, 001, 000, 000, 000, 015, 003, 003, 001, 000, 000, 000, 011, 004, 001, 001, 000, 012, 006, 031, 000, 008, 000, 000, 022, 001, 000, 000, 000, 026, 003, 005, 001, 000, 000, 000, 010, 002, 005, 001, 000, 000, 000, 009, 003, 004, 001, 000, 012, 006, 108, 000, 009, 000, 012, 004, 140, 000, 016, 000, 010, 000, 012, 006, 125, 000, 008, 000, 011, 000, 000, 010, 001, 000, 012, 001, 092, 000, 016, 000, 012, 003, 113, 000, 016, 000, 012, 001, 017, 000, 015, 000, 012, 003, 000, 012, 001, 000, 008, 000, 011, 000, 010, 000, 010, 000, 000, 006, 001, 000, 012, 001, 163, 000, 009, 000, 012, 003, 000, 012, 001, 000, 015, 000, 010, 000, 000, 015, 001, 000, 012, 002, 013, 000, 016, 000, 012, 005, 091, 000, 006, 000, 010, 000, 000, 011, 001, 000, 000, 000, 022, 004, 005, 001, 000, 012, 003, 140, 000, 009, 000, 012, 007, 098, 000, 009, 000, 010, 000, 012, 001, 071, 000, 008, 000, 012, 007, 210, 000, 008, 000, 011, 000, 010, 000, 000, 015, 001, 000, 000, 000, 006, 005, 003, 001, 000, 012, 006, 045, 000, 015, 000, 000, 011, 001, 000, 000, 000, 005, 005, 009, 001, 000, 012, 006, 158, 000, 015, 000, 012, 006, 132, 000, 009, 000, 012, 004, 080, 000, 009, 000, 012, 002, 000, 012, 005, 000, 016, 000, 010, 000, 011, 000, 011, 000, 000, 006, 001, 000, 012, 003, 247, 000, 008, 000, 012, 004, 089, 000, 008, 000, 011, 000, 000, 009, 001, 000, 012, 005, 253, 000, 016, 000, 000, 004, 001, 000, 012, 005, 095, 000, 009, 000, 012, 006, 045, 000, 009, 000, 010, 000, 000, 019, 001, 000, 012, 005, 081, 000, 015, 000, 012, 005, 213, 000, 009, 000, 010, 000, 000, 026, 001, 000, 012, 007, 000, 012, 005, 000, 015, 000, 000, 011, 001, 000, 000, 000, 004, 005, 003, 001, 000, 000, 000, 019, 005, 001, 001, 000, 012, 007, 000, 012, 002, 000, 015, 000, 000, 002, 001, 000, 000, 000, 002, 005, 004, 001, 000, 012, 006, 143, 000, 008, 000, 012, 007, 199, 000, 015, 000, 011, 000, 000, 002, 001, 000, 000, 000";
        String schlechtesGenom = "001, 003, 001, 001, 000, 013, 000, 000, 002, 001, 000, 000, 000, 002, 004, 001, 001, 000, 000, 000";
        Vector2D pos;
        double richt;
       
        if (numGoodAgents < 1) {
            numGoodAgents = 1;
        }
        if (numBadAgents < 1) {
            numBadAgents = 1;
        }
       
        Rectangle2D bound = new Rectangle2D(env.getBoundingBox(false));
       
        double puffer = 100;
        bound.setLeft(bound.upperLeftCorner().x + puffer);
        bound.setRight(bound.lowerRightCorner().x - puffer);
        bound.setTop(bound.upperLeftCorner().y + puffer);
        bound.setBottom(bound.lowerRightCorner().y - puffer);
       
        for (int j = 0; j < numGoodAgents; j++) {
            agent = new JasmineRobotWithoutMutationRegularSelection(
                    j,
                    env,
                    rand,
                    params,
                    true,
                    360,
                    gutesGenom,
                    schlechtesGenom);
            brain = new MARBBrain<AbstractAgent2D<?>>(
                    agent,
                    gutesGenom,
                    params);
            agent.implantBrain(brain);

            pos = new Vector2D(
                    rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                    rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            richt = rand.nextDouble() * 360;
           
            while (!env.addCollidingAgent(
                    agent,
                    pos, richt)) {
                pos = new Vector2D(
                        rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                        rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            }
           
        }

        for (int j = 0; j < numBadAgents; j++) {
            agent = new JasmineRobotWithoutMutationRegularSelection(
                    j,
                    env,
                    rand,
                    params,
                    true,
                    360,
                    gutesGenom,
                    schlechtesGenom);
            brain = new MARBBrain<AbstractAgent2D<?>>(
                    agent,
                    schlechtesGenom,
                    params);
            agent.implantBrain(brain);

            pos = new Vector2D(
                    rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                    rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            richt = rand.nextDouble() * 360;
           
            while (!env.addCollidingAgent(
                    agent,
                    pos, richt)) {
                pos = new Vector2D(
                        rand.nextDouble() * (bound.lowerRightCorner().x - bound.upperLeftCorner().x) + bound.upperLeftCorner().x,
                        rand.nextDouble() * (bound.lowerRightCorner().y - bound.upperLeftCorner().y) + bound.upperLeftCorner().y);
            }
           
        }
       
        env.getJasmineAgents();
       
        return new MARBFastEnvironment[] { env };
    }
View Full Code Here

Examples of eas.users.lukas.marbImplicitEvolution.simpleMazeEnvironment.MARBFastEnvironment

    @SuppressWarnings("unchecked")
    @Override
    public AbstractEnvironment2D<AbstractAgent2D<?>>[] generateRunnables(
            ParCollection params) {
        MARBFastEnvironment env = new MARBFastEnvironment(0, params, false);
       
        int anzahl = 10;
       
        for (int i = 0; i < anzahl; i++) {
            JasmineRobot r = new JasmineRobot(i, env, new Random(), params, false, 0);
            r.implantBrain(new MARBBrain<AbstractAgent2D<?>>(
                    r,
    //                "001, 003, 001, 001, 000, 000, 000",
                    "001, 003, 001, 001, 000, 014, 000, 013, 000, 014, 203, 000, 012, 002, 000, 005, 000, 011, 000, 010, 000, 011, 000, 000, 005, 001, 000, 000, 000, 018, 003, 005, 001, 000, 000, 000, 016, 004, 001, 001, 000, 000, 000, 017, 004, 003, 001, 000, 000, 000, 015, 003, 004, 001, 000, 014, 000, 000, 015, 001, 000, 000, 000, 014, 004, 005, 001, 000, 000, 000, 013, 003, 006, 001, 000, 000, 000, 012, 001, 002, 001, 000, 000, 000, 011, 003, 008, 001, 000, 000, 000, 010, 005, 002, 001, 000, 012, 007, 130, 000, 007, 000, 000, 001, 001, 000, 000, 000, 008, 004, 003, 001, 218, 000, 012, 001, 000, 009, 000, 012, 004, 000, 012, 001, 000, 007, 000, 010, 000, 000, 001, 001, 000, 012, 003, 111, 000, 008, 171, 000, 012, 007, 000, 005, 000, 011, 000, 000, 005, 001, 052, 000, 012, 007, 000, 008, 000, 000, 011, 001, 000, 000, 000, 007, 005, 005, 001, 017, 000, 012, 006, 000, 015, 000, 000, 013, 001, 000, 000, 000, 006, 005, 004, 001, 000, 000, 000, 005, 004, 004, 001, 000, 000, 000, 004, 001, 002, 001, 000, 000, 000, 003, 001, 005, 001, 000, 000, 000, 002, 001, 002, 001, 000, 000, 000",
                    params));
            env.addCollidingAgent(r, new Vector2D(-anzahl * 15.5 + i * 33, 800), new Random().nextDouble() * 360);
            r.deactivateEvolution();
        }
       
        return new AbstractEnvironment2D[] { env };
    }
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.