Tabnine Logo
Scenario.getStopCondition
Code IndexAdd Tabnine to your IDE (free)

How to use
getStopCondition
method
in
com.github.rinde.rinsim.scenario.Scenario

Best Java code snippets using com.github.rinde.rinsim.scenario.Scenario.getStopCondition (Showing top 8 results out of 315)

origin: com.github.rinde/rinsim-scenario

/**
 * Copies properties of the specified scenario into this builder.
 * @param scenario The scenario to copy the properties from.
 * @return This, as per the builder pattern.
 */
protected T copyProperties(Scenario scenario) {
 timeWindow = scenario.getTimeWindow();
 stopCondition = scenario.getStopCondition();
 return self();
}
origin: rinde/RinSim

/**
 * Copies properties of the specified scenario into this builder.
 * @param scenario The scenario to copy the properties from.
 * @return This, as per the builder pattern.
 */
protected T copyProperties(Scenario scenario) {
 timeWindow = scenario.getTimeWindow();
 stopCondition = scenario.getStopCondition();
 return self();
}
origin: com.github.rinde/rinsim-scenario

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof Scenario) {
  Scenario that = (Scenario) o;
  return (this.events.equals(that.getEvents()))
     && (this.modelBuilders.equals(that.getModelBuilders()))
     && (this.timeWindow.equals(that.getTimeWindow()))
     && (this.stopCondition.equals(that.getStopCondition()))
     && (this.problemClass.equals(that.getProblemClass()))
     && (this.problemInstanceId.equals(that.getProblemInstanceId()));
 }
 return false;
}
origin: rinde/RinSim

@Override
public boolean equals(Object o) {
 if (o == this) {
  return true;
 }
 if (o instanceof Scenario) {
  Scenario that = (Scenario) o;
  return (this.events.equals(that.getEvents()))
     && (this.modelBuilders.equals(that.getModelBuilders()))
     && (this.timeWindow.equals(that.getTimeWindow()))
     && (this.stopCondition.equals(that.getStopCondition()))
     && (this.problemClass.equals(that.getProblemClass()))
     && (this.problemInstanceId.equals(that.getProblemInstanceId()));
 }
 return false;
}
origin: com.github.rinde/rinsim-scenario

static Builder create(Scenario scen) {
 final int ticks = scen.getTimeWindow().end() == Long.MAX_VALUE ? -1
  : (int) (scen.getTimeWindow().end() - scen.getTimeWindow().begin());
 return create(
  scen,
  ImmutableMap.<Class<? extends TimedEvent>, TimedEventHandler<?>>of(),
  ticks,
  StopModelBuilder.create(scen.getStopCondition()), false);
}
origin: rinde/RinSim

static Builder create(Scenario scen) {
 final int ticks = scen.getTimeWindow().end() == Long.MAX_VALUE ? -1
  : (int) (scen.getTimeWindow().end() - scen.getTimeWindow().begin());
 return create(
  scen,
  ImmutableMap.<Class<? extends TimedEvent>, TimedEventHandler<?>>of(),
  ticks,
  StopModelBuilder.create(scen.getStopCondition()), false);
}
origin: rinde/RinSim

/**
 * Test the default settings of a scenario.
 */
@Test
public void testDefaults() {
 final Scenario.Builder builder = Scenario
  .builder(Scenario.DEFAULT_PROBLEM_CLASS);
 assertThat(builder.getTimeWindow())
  .isEqualTo(TimeWindow.create(0, 8 * 60 * 60 * 1000));
 assertThat(builder.getStopCondition())
  .isEqualTo(StopConditions.alwaysFalse());
 final Scenario scenario = builder.build();
 assertTrue(scenario.getModelBuilders().isEmpty());
 assertSame(Scenario.DEFAULT_PROBLEM_CLASS, scenario.getProblemClass());
 assertEquals("", scenario.getProblemInstanceId());
 assertThat(scenario.getStopCondition()).isEqualTo(
  StopConditions.alwaysFalse());
 assertEquals(TimeWindow.create(0, 8 * 60 * 60 * 1000),
  scenario.getTimeWindow());
}
origin: rinde/RinSim

assertEquals(TimeWindow.create(0L, 7L), scenario.getTimeWindow());
assertThat(scenario.getStopCondition()).isEqualTo(
 StopConditions.alwaysTrue());
assertEquals(1, scenario.getModelBuilders().size());
com.github.rinde.rinsim.scenarioScenariogetStopCondition

Popular methods of Scenario

  • builder
    Copying builder. Creates a new builder that builds instances with the same properties as the specifi
  • getTimeWindow
  • getEvents
    Return a scenario as a list of (time sorted) events.
  • getModelBuilders
  • getProblemClass
  • getProblemInstanceId
  • asQueue
  • equals
  • hashCode
  • create

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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