Package gld.infra

Examples of gld.infra.Node


  {
    int acp, bcp;
      acp = road.getAlphaNode().isConnectedAt(road);
      bcp = road.getBetaNode().isConnectedAt(road);

    Node alphaNode = road.getAlphaNode();
    Node betaNode = road.getBetaNode();

    int alphaMaxWidth = alphaNode.getWidth();
    int betaMaxWidth = betaNode.getWidth();

    int cax=0,cay=0,cbx=0,cby=0;
    double alphaAngle, betaAngle;

  // calculate the starting positions of the road
    if(acp == 0)    // alpha top
    {
          cax = alphaNode.getCoord().x;
          cay = alphaNode.getCoord().y - alphaMaxWidth * 5 - 1;
          alphaAngle = Math.toRadians(90);
      }
      else if(acp == 1) // alpha right
      {
            cax = alphaNode.getCoord().x + alphaMaxWidth * 5 + 1;
            cay = alphaNode.getCoord().y;
            alphaAngle = 0.0;
        }
        else if(acp == 2) // alpha bottom
        {
            cax = alphaNode.getCoord().x;
            cay = alphaNode.getCoord().y + alphaMaxWidth * 5 + 1;
            alphaAngle = Math.toRadians(270);
        }
        else    // alpha left
        {
            cax = alphaNode.getCoord().x - alphaMaxWidth * 5 - 1;
            cay = alphaNode.getCoord().y;
            alphaAngle = Math.toRadians(180);
        }
   
        if(bcp == 0)    // beta top
        {
            cbx = betaNode.getCoord().x;
            cby = betaNode.getCoord().y - betaMaxWidth * 5 - 1;
            betaAngle = Math.toRadians(270);
        }
        else if(bcp == 1) // beta right
        {
            cbx = betaNode.getCoord().x + betaMaxWidth * 5 + 1;
            cby = betaNode.getCoord().y;
            betaAngle = Math.toRadians(180);
        }
        else if(bcp == 2) // beta bottom
        {
            cbx = betaNode.getCoord().x;
            cby = betaNode.getCoord().y + betaMaxWidth * 5 + 1;
            betaAngle = Math.toRadians(90);
        }
        else    // beta left
        {
            cbx = betaNode.getCoord().x - betaMaxWidth * 5 - 1;
            cby = betaNode.getCoord().y;
            betaAngle = 0.0;
        }

        Point alphaCoord = new Point(cax,cay);
        Point betaCoord = new Point(cbx,cby);
View Full Code Here


    int acp, bcp;
      acp = road.getAlphaNode().isConnectedAt(road);
      bcp = road.getBetaNode().isConnectedAt(road);

    Node alphaNode = road.getAlphaNode();
    Node betaNode = road.getBetaNode();

    int alphaMaxWidth = alphaNode.getWidth();
    int betaMaxWidth = betaNode.getWidth();

    int cax=0,cay=0,cbx=0,cby=0;
    double alphaAngle, betaAngle;

  // calculate the starting positions of the road
    if(acp == 0)    // alpha top
    {
          cax = alphaNode.getCoord().x;
          cay = alphaNode.getCoord().y - alphaMaxWidth * 5 - 1;
          alphaAngle = Math.toRadians(90);
      }
      else if(acp == 1) // alpha right
      {
            cax = alphaNode.getCoord().x + alphaMaxWidth * 5 + 1;
            cay = alphaNode.getCoord().y;
            alphaAngle = 0.0;
        }
        else if(acp == 2) // alpha bottom
        {
            cax = alphaNode.getCoord().x;
            cay = alphaNode.getCoord().y + alphaMaxWidth * 5 + 1;
            alphaAngle = Math.toRadians(270);
        }
        else    // alpha left
        {
            cax = alphaNode.getCoord().x - alphaMaxWidth * 5 - 1;
            cay = alphaNode.getCoord().y;
            alphaAngle = Math.toRadians(180);
        }
   
        if(bcp == 0)    // beta top
        {
            cbx = betaNode.getCoord().x;
            cby = betaNode.getCoord().y - betaMaxWidth * 5 - 1;
            betaAngle = Math.toRadians(270);
        }
        else if(bcp == 1) // beta right
        {
            cbx = betaNode.getCoord().x + betaMaxWidth * 5 + 1;
            cby = betaNode.getCoord().y;
            betaAngle = Math.toRadians(180);
        }
        else if(bcp == 2) // beta bottom
        {
            cbx = betaNode.getCoord().x;
            cby = betaNode.getCoord().y + betaMaxWidth * 5 + 1;
            betaAngle = Math.toRadians(90);
        }
        else    // beta left
        {
            cbx = betaNode.getCoord().x - betaMaxWidth * 5 - 1;
            cby = betaNode.getCoord().y;
            betaAngle = 0.0;
        }

        Point alphaCoord = new Point(cax,cay);
        Point betaCoord = new Point(cbx,cby);
View Full Code Here

  private void updatePriorities() {
    this.initializeTLD();
    int nodesLenght = tls.length;
    int signConfLenght;
    Node node = null;
    Node[] nodes = super.infra.getAllNodes();
    for (int i = 0; i < nodesLenght; i++) {
      node = nodes[i];
      if (node instanceof Junction) {
        signConfLenght = tls[i].length;
View Full Code Here

TOP

Related Classes of gld.infra.Node

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.