Examples of Station


Examples of at.dotti.railway.manager.stations.Station

public class RailwayManagerMain {

  public RailwayManagerMain() {
    // - create a railway net
    Station klbgWdlg = new Station() {

      @Override
      public String getName() {
        return "Klosterneuburg Weidling";
      }
    };
    Platform p1 = new SimplePlatform();
    Platform p2 = new SimplePlatform();
    Platform p3 = new SimplePlatform();
    klbgWdlg.addPlatform(p1);
    klbgWdlg.addPlatform(p2);
    klbgWdlg.addPlatform(p3);
    Rail p1r1 = new SimpleRail();
    p1.addRail(p1r1);
    Rail p2r1 = new SimpleRail();
    p2.addRail(p2r1);
    Rail p3r1 = new SimpleRail();
View Full Code Here

Examples of com.bergerkiller.bukkit.tc.Station

    if (!info.hasRails() || !info.hasGroup() || info.getGroup().isEmpty()) {
      return;
    }
    //Check if not already targeting
    MinecartGroup group = info.getGroup();
    Station station = new Station(info);
    if (!station.isValid()) {
      return;
    }

    //What do we do?
    if (station.getInstruction() == null) {
      // Clear actions, but only if requested to do so because of a redstone change
      if (info.isAction(SignActionType.REDSTONE_CHANGE)) {
        info.getGroup().getActions().clear();
      }
    } else if (station.getInstruction() == BlockFace.SELF) {
      MinecartMember<?> centerMember = station.getCenterCart();
      // Do not allow redstone changes to center a launching train
      if (info.isAction(SignActionType.REDSTONE_CHANGE) && (centerMember.isMovementControlled() || info.getGroup().isMoving())) {
        return;
      }

      //Brake
      //TODO: ADD CHECK?!
      group.getActions().clear();   
      BlockFace trainDirection = station.getNextDirection().getDirection(info.getFacing(), info.getMember().getDirection());
      if (station.getNextDirection() != Direction.NONE) {
        // Actual launching here
        if (station.hasDelay()) {
          station.centerTrain();
          station.waitTrain(station.getDelay());
        } else if (!info.getMember().isDirectionTo(trainDirection)) {
          // Order the train to center prior to launching again
          station.centerTrain();
        }
        station.launchTo(trainDirection, station.getLength());
      } else {
        station.centerTrain();
        station.waitTrain(Long.MAX_VALUE);
      }
    } else {
      //Launch
      group.getActions().clear();
      MinecartMember<?> head = group.head();

      if (station.hasDelay() || (head.isMoving() && !info.getMember().isDirectionTo(station.getInstruction()))) {
        //Reversing or has delay, need to center it in the middle first
        station.centerTrain();
      }
      if (station.hasDelay()) {
        station.waitTrain(station.getDelay());
      }
      station.launchTo(station.getInstruction(), station.getLength());
    }
  }
View Full Code Here

Examples of com.masabi.routefinder.Station

    Assert.assertNotNull(route);
    Assert.assertEquals(route.size(), numConnectionsExpected);

    Connection[] connections = values.toArray(new Connection[numConnectionsExpected]);

    Assert.assertEquals(connections[0].getStationFrom(), new Station("A"));
    Assert.assertEquals(connections[0].getStationTo(), new Station("G"));

    Assert.assertEquals(connections[1].getStationFrom(), new Station("G"));
    Assert.assertEquals(connections[1].getStationTo(), new Station("F"));

    Assert.assertEquals(connections[2].getStationFrom(), new Station("F"));
    Assert.assertEquals(connections[2].getStationTo(), new Station("H"));
   
  }
View Full Code Here

Examples of engine.Station

     
      for(Passenger p : train.getPassengerListToStation(station)) {
        if(!p.isLate()) onTime++;
      }
     
      Station  underTrain = map.getStationAtTile(train.getGridLocation());
      if(underTrain != null && underTrain.equals(station)) {
        stations += "\\#76e639#";
      }
      stations += station.getName() + " (" + onTime + " / " + train.getPassengersToStation(station)+") ";
     
      if(underTrain != null && underTrain.equals(station)) {
        stations += "<--";
      }
      stations += "\n";
    }
   
View Full Code Here

Examples of engine.Station

   
    this.passengerEmitter.render();
  }
 
  public void unload() {
    Station station = this.map.getStationAtTile(this.getGridLocation());
   
    if(station != null) {
      ArrayList<Passenger> remove = new ArrayList();
     
      for(Passenger passenger : this.getPassengers()) {
View Full Code Here

Examples of engine.Station

  @Override
  public void load() {
    super.load();
    //this.removePassengers((int) (Math.random()*this.capacity));
    //this.addPassengers((int) (Math.random()*this.capacity));
    Station station = this.map.getStationAtTile(this.getGridLocation());
   
    if(station != null) {
      ArrayList<Passenger> remove = new ArrayList();
      for(Passenger p: station.getPassengers()) {
        if(this.getPassengerCount() < this.capacity) {
          this.addPassenger(p);
          //this.addCash(2.50f);
          remove.add(p);
        }
      }
     
      for(Passenger p: remove) {
        station.getPassengers().remove(p);
      }
    }
  }
View Full Code Here

Examples of model.Station

  public void searchScheduleByLineAndStation()
  {
    Timetable timetable1 = new Timetable();
   
    Line line1 = new Line();
    Station station1 = new Station();
   
    timetable1.setLine(line1);
    timetable1.setStation(station1);
    map.getTimetables().add(timetable1);
   
    assertEquals(1, map.searchSchedule(line1, station1).size());
   
    Timetable timetable2 = new Timetable();
    Line line2 = new Line();
    Station station2 = new Station();
   
    timetable2.setLine(line2);
    timetable2.setStation(station2);
    map.getTimetables().add(timetable2);
   
    Timetable timetable3 = new Timetable();
    Line line3 = new Line();
    Station station3 = new Station();
   
    timetable3.setLine(line3);
    timetable3.setStation(station3);
    map.getTimetables().add(timetable3);
   
View Full Code Here

Examples of model.Station

  @Test
  public void searchScheduleByStation()
  {
    Timetable timetable1 = new Timetable()
    Line line1 = new Line();
    Station station1 = new Station();
   
    timetable1.setLine(line1);
    timetable1.setStation(station1);
    map.getTimetables().add(timetable1);
   
    assertEquals(1, map.searchSchedule(station1).size());
   
    Timetable timetable2 = new Timetable();
    Line line2 = new Line();
    Station station2 = new Station();
   
    timetable2.setLine(line2);
    timetable2.setStation(station2);
    map.getTimetables().add(timetable2);
   
    Timetable timetable3 = new Timetable();
    Line line3 = new Line();
    Station station3 = new Station();
   
    timetable3.setLine(line3);
    timetable3.setStation(station3);
    map.getTimetables().add(timetable3);
   
View Full Code Here

Examples of model.Station

 
 
  @Test //test de maxMinCoordinates
  public void testMaxMinCoordinates(){
    LinkedList <Station> stations = new LinkedList<Station>();
    stations.add(new Station(5, "stat1", 0, 0, "ville1"));
    stations.add(new Station(6, "stat2", 5, 5, "ville1"));
    stations.add(new Station(7, "stat3", 6, -1, "ville2"));
   
    test.getMap().setStations(stations);
   
    double[][] maxmin = test.getMaxMinCoordinate();   
   
View Full Code Here

Examples of model.Station

  public void testGetStationsNames(){
    String[] noms = new String[] {"Nom1", "Nom2", "Nom3"};
   
   
    LinkedList <Station> stations = new LinkedList<Station>();
    stations.add(new Station(5, noms[0], 0, 0, "ville1"));
    stations.add(new Station(6, noms[1], 5, 5, "ville1"));
    stations.add(new Station(7, noms[2], 6, -1, "ville2"));
   
    test.getMap().setStations(stations);
   
    assertArrayEquals(noms, test.getStationsNames());
  }
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.