Tabnine Logo
Event.getIssuer
Code IndexAdd Tabnine to your IDE (free)

How to use
getIssuer
method
in
com.github.rinde.rinsim.event.Event

Best Java code snippets using com.github.rinde.rinsim.event.Event.getIssuer (Showing top 4 results out of 315)

origin: rinde/RinSim

void doHandleEvent(Event e) {
 synchronized (computingSimSolvers) {
  final boolean isComputingBefore = isComputing();
  LOGGER.trace("receive: {}, computing: {}, clock is ticking: {}, {}", e,
   isComputingBefore, clock.isTicking(), computingSimSolvers);
  if (e.getEventType() == EventType.START_COMPUTING) {
   if (!isComputingBefore) {
    LOGGER.debug("start computing -> switch to real time");
    clock.switchToRealTime();
   }
   computingSimSolvers.add((RtSimSolverSchedulerBridge) e.getIssuer());
  } else if (e.getEventType() == EventType.DONE_COMPUTING) {
   // done computing
   checkState(computingSimSolvers.remove(e.getIssuer()));
   // if (!isComputing()) {
   // stop();
   // }
  } else {
   throw new IllegalArgumentException("Unexpected event: " + e);
  }
 }
}
origin: rinde/RinSim

 @Override
 public void handleEvent(Event event) {
  assertSame(event.toString(), modelRef, event.getIssuer());
 }
}, PDPModelEventType.values());
origin: rinde/RinSim

@Test
public void followPathEventIssuerType() {
 final MovingRoadUser user = new TestRoadUser();
 model.addObjectAt(user, SW);
 final ListenerEventHistory list = new ListenerEventHistory();
 model.getEventAPI().addListener(list, RoadEventType.MOVE);
 assertTrue(list.getHistory().isEmpty());
 model.followPath(user, newLinkedList(asList(SW, SE, NE, NW)),
  TimeLapseFactory.create(0, 10));
 assertEquals(1, list.getHistory().size());
 assertEquals(RoadEventType.MOVE, list.getHistory().get(0).getEventType());
 assertEquals(model, list.getHistory().get(0).getIssuer());
}
origin: rinde/RinSim

@Test
public void moveToEventIssuerType() {
 final MovingRoadUser user = new TestRoadUser();
 model.addObjectAt(user, SW);
 final ListenerEventHistory list = new ListenerEventHistory();
 model.getEventAPI().addListener(list, RoadEventType.MOVE);
 assertTrue(list.getHistory().isEmpty());
 model.moveTo(user, NW, TimeLapseFactory.create(0, 10));
 assertEquals(1, list.getHistory().size());
 assertEquals(RoadEventType.MOVE, list.getHistory().get(0).getEventType());
 assertEquals(model, list.getHistory().get(0).getIssuer());
}
com.github.rinde.rinsim.eventEventgetIssuer

Popular methods of Event

  • getEventType
  • <init>
    Create a new event instance.
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Permission (java.security)
    Legacy security code; do not use.
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now