Examples of Intersection


Examples of wolf.city.road.Intersection

      s.executeUpdate("DROP TABLE IF EXISTS INTERSECTIONS;");
      s.executeUpdate("CREATE TABLE INTERSECTIONS (id, x, y, z);");

      PreparedStatement p = con.prepareStatement("INSERT INTO INTERSECTIONS VALUES (?, ?, ?, ?);");
      for(int i=0; i<Intersection.intersections.size(); i++){
        Intersection is = Intersection.intersections.get(i);
        p.setInt(1, is.id);
        p.setDouble(2, is.pos.x);
        p.setDouble(3, is.pos.y);
        p.setDouble(4, is.pos.z);
        p.addBatch();
View Full Code Here

Examples of wolf.city.road.Intersection

      }

      t.angle = angle;
      t.move((float)roadLength);
     
      returnRoad = new Road(road.b, new Intersection(new Coordinate(t.pos)), nextRoadType, new Basic(c), road);
    }
    return returnRoad;
  }
View Full Code Here

Examples of wolf.city.road.Intersection

      angle = RandomHelper.random(city.random.nextFloat(), 20, -20);
      nextRoadType = RoadType.HIGHWAY;
      double roadLength = Math.abs(Math.sin(Math.toRadians((previousAngle-angle)%360))*nextRoadLength); //sin approximates how long next road should be
      t.angle = angle;
      t.move((float)roadLength);
      returnRoad = new Road(road.b, new Intersection(new Coordinate(t.pos)), nextRoadType, this, road); //roads set to default should die.
    }else{
      returnRoad = new Road(road.b, new Intersection(bestPosition), nextRoadType, this, road); //roads set to default should die.
    }
    return returnRoad;
  }
View Full Code Here

Examples of wolf.city.road.Intersection

    c = g.c;
  }
  @Override
  public Road globalGoals(City city, Road road, Direction d) {
    double previousAngle = Math.toDegrees(Angle.angle(road.a.pos, road.b.pos));
    Road r = new Road(road.b, new Intersection(road.b.pos), RoadType.STREET, this, road);
    Turtle t;
    if(road.getType() == RoadType.HIGHWAY){// || road.type == RoadType.MAIN){
      t = new Turtle(r.a.pos, previousAngle);
    }else{
      double angle = (Math.floor((previousAngle+45)/90)*90+direction);
 
View Full Code Here

Examples of wolf.city.road.Intersection

  private City c;
  private Road testedRoad;
 
  public LCPanel(){
    roads = new LinkedList<Road>();
    testRoad = new Road(new Intersection(new Coordinate(10,100)),new Intersection(new Coordinate(400,400)), RoadType.HIGHWAY, null);
    roads.add(new Road(new Intersection(new Coordinate(100,10)),new Intersection(new Coordinate(400,300)), RoadType.HIGHWAY, null));
    roads.add(new Road(new Intersection(new Coordinate(50,25)),new Intersection(new Coordinate(400,200)), RoadType.HIGHWAY, null));
    c = new City(windowHeight*4, windowHeight*4, 0);
    rm = new Roadmap(c);
    for(Road r: roads){
      rm.roads.insert(r.getEnvelope(), r);
    }
View Full Code Here

Examples of wolf.city.road.Intersection


  public Intersection getNearestIntersection(){
   
    double closestDistance = 25; //25 is largest distance to snap to
    Intersection closest = null;
   
    for(int i=0;i<roads.size();i++){
      if(roads.get(i).a.pos.distance(mouseLoc)<closestDistance) closest = roads.get(i).a;
      if(roads.get(i).b.pos.distance(mouseLoc)<closestDistance) closest = roads.get(i).b;
    }
View Full Code Here

Examples of wyvern.tools.types.extensions.Intersection

                  meth.getReturnType()));
    }
    if (methTypes.size() == 1)
      return methTypes.get(0);
    else if (methTypes.size() > 1)
      return new Intersection(methTypes);
    return null;
  }
View Full Code Here

Examples of wyvern.tools.types.extensions.Intersection

      argument = ((Arrow) fnType).getArgument();
    else if (fnType instanceof Intersection) {
      List<Type> args = fnType.getChildren().values().stream()
          .filter(tpe -> tpe instanceof Arrow).map(tpe->((Arrow)tpe).getArgument())
          .collect(Collectors.toList());
      argument = new Intersection(args);
    }
    if (this.argument != null)
      this.argument.typecheck(env, Optional.ofNullable(argument));
   
    if (!(fnType instanceof ApplyableType))
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.