Package rinde.sim.core.graph

Examples of rinde.sim.core.graph.Point


  @Test(expected = IllegalArgumentException.class)
  public void addTruckTest() {
    final RoadUser agent1 = new TestRoadUser();
    final RoadUser agent2 = new TestRoadUser();
    model.addObjectAt(agent1, new Point(0, 0));
    model.addObjectAt(agent2, new Point(1, 0));// this location is not a
                                               // crossroad
  }
View Full Code Here


    graph = g;
  }

  @Test
  public void pointsEqual() {
    Point p1 = new Point(0.1, 0.2);
    Point p2 = new Point(0.1, 0.2);
    assertEquals(p1, p1);
    assertEquals(p2, p2);
    assertEquals(p1, p2);

    assertEquals(p1, Point.duplicate(p1));
View Full Code Here

  }

  @Test
  public void testRegister() {

    TestCommunicationUser user = new TestCommunicationUser(new Point(0, 10), 10, 1, null);
    boolean register = model.register(user);
    assertTrue(register);
    assertTrue(model.users.contains(user));
  }
View Full Code Here

  }

  @Test
  public void testRegisterException() {

    TestCommunicationUser user = new TestCommunicationUser(new Point(0, 10), 10, 1, null) {

      @Override
      public void setCommunicationAPI(CommunicationAPI api) {
        throw new RuntimeException();
      }
View Full Code Here

    assertFalse(model.users.contains(user));
  }

  @Test
  public void testUnregister() {
    TestCommunicationUser user = new TestCommunicationUser(new Point(0, 10), 10, 1, null);
    boolean res = model.register(user);
    assertTrue(res);
    assertTrue(model.users.contains(user));
    res = model.unregister(user);
View Full Code Here

  @Test
  public void testSimpleSend() {
    final boolean[] res = new boolean[1];

    TestCommunicationUser sender = new TestCommunicationUser(new Point(0, 10), 10, 1, null);
    TestCommunicationUser recipient = new TestCommunicationUser(new Point(0, 10), 10, 1, new Callback() {

      @Override
      void callBack(Message m) {
        res[0] = true;
      }
View Full Code Here

  @Test
  public void testMaxDistanceSend() {
    final boolean[] res = new boolean[1];

    TestCommunicationUser sender = new TestCommunicationUser(new Point(0, 0), 10, 1, null);
    TestCommunicationUser recipient = new TestCommunicationUser(new Point(0, 5), 5, 1, new Callback() {

      @Override
      void callBack(Message m) {
        res[0] = true;
      }
View Full Code Here

  @Test
  public void testUnsendSend() {
    final boolean[] res = new boolean[1];

    // the distance is greater than min radius
    TestCommunicationUser sender = new TestCommunicationUser(new Point(0, 0), 10, 1, null);
    TestCommunicationUser recipient = new TestCommunicationUser(new Point(0, 5), 4, 1, new Callback() {

      @Override
      void callBack(Message m) {
        res[0] = true;
      }
View Full Code Here

  @Test
  public void testUnsendOnUnregister() {
    final boolean[] res = new boolean[1];

    // the distance is greater than min radius
    TestCommunicationUser sender = new TestCommunicationUser(new Point(0, 0), 10, 1, null);
    TestCommunicationUser recipient = new TestCommunicationUser(new Point(0, 5), 15, 1, new Callback() {

      @Override
      void callBack(Message m) {
        res[0] = true;
      }
View Full Code Here

  @Test
  public void testUnsendOnUnregister2() {
    final boolean[] res = new boolean[1];

    // the distance is greater than min radius
    TestCommunicationUser sender = new TestCommunicationUser(new Point(0, 0), 10, 1, null);
    TestCommunicationUser recipient = new TestCommunicationUser(new Point(0, 5), 15, 1, new Callback() {

      @Override
      void callBack(Message m) {
        res[0] = true;
      }
View Full Code Here

TOP

Related Classes of rinde.sim.core.graph.Point

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.