Package eas.simulation.agent

Examples of eas.simulation.agent.AbstractAgent


                    (int) (rect.upperLeftCorner().x + rect.getWidth()),
                    (int) (rect.upperLeftCorner().y + rect.getHeight()));
        } catch (Exception e1) {
        }
       
        AbstractAgent bester = this.bester(env.getAgents());
        int radius = 20;
        String zusatzAnzeigeModus = (String) params
                .getParValue(AllroundVideoPlugin.ZUSATZ_BILD_PAR);

        if (this.markedAgentId != null) {
            bester = env.getAgent(this.markedAgentId);
        }
       
        if (zusatzAnzeigeModus.equalsIgnoreCase(
                AllroundVideoPlugin.MODUS_BESTER) && bester != null) {
            g.setColor(Color.red);
            g.setStroke(new BasicStroke(
                    4,
                    BasicStroke.CAP_ROUND,
                    BasicStroke.JOIN_ROUND));
            try {
                g.setColor(Color.red);
                double height = 25;
                double width = 25;
                Vector2D agPos = ((AbstractEnvironment2D) this.currentEnv).getPointInVisualization(((AbstractEnvironment2D) this.currentEnv).getAgentPosition(this.markedAgentId));
                agPos.sub(new Vector2D(width / 2, height / 2));
                g.drawOval((int) agPos.x, (int) agPos.y, (int) (width), (int) (height));
               
                Polygon2D pol2D = ((AbstractEnvironment2D) this.currentEnv).getAgentShapeInVisualization(this.markedAgentId);
                Polygon pol = pol2D.toPol();
                g.setColor(Color.red);
                g.drawPolygon(pol);
            } catch (Exception e) {
                try {
                    g.drawOval(
                            (int) env.getPositionInVisualization(bester.id()).x - radius / 2,
                            (int) env.getPositionInVisualization(bester.id()).y - radius / 2,
                            radius,
                            radius);
                } catch (Exception e1) {}
            }
        } else if (zusatzAnzeigeModus.startsWith(
View Full Code Here

TOP

Related Classes of eas.simulation.agent.AbstractAgent

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.