Codota Logo
Scenario$Builder.removeModelsOfType
Code IndexAdd Codota to your IDE (free)

How to use
removeModelsOfType
method
in
com.github.rinde.rinsim.scenario.Scenario$Builder

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: com.github.rinde/rinsim-scenario

 @Override
 @Nullable
 public Scenario apply(@Nullable Scenario input) {
  return Scenario.builder(verifyNotNull(input))
   .removeModelsOfType(TimeModel.AbstractBuilder.class)
   .addModel(timeModel)
   .build();
 }
};
origin: rinde/RinSim

 @Override
 @Nullable
 public Scenario apply(@Nullable Scenario input) {
  return Scenario.builder(verifyNotNull(input))
   .removeModelsOfType(TimeModel.AbstractBuilder.class)
   .addModel(timeModel)
   .build();
 }
};
origin: com.github.rinde/rinsim-scenario

@Nullable
@Override
public Scenario apply(@Nullable Scenario input) {
 final Scenario in = verifyNotNull(input);
 final Optional<TimeModel.AbstractBuilder<?>> timeModel =
  getTimeModel(in);
 final TimeModel.Builder rtb = TimeModel.builder();
 if (timeModel.isPresent()) {
  rtb.withTickLength(timeModel.get().getTickLength())
   .withTimeUnit(timeModel.get().getTimeUnit());
 }
 return Scenario.builder(in)
  .removeModelsOfType(TimeModel.AbstractBuilder.class)
  .addModel(rtb)
  .build();
}
origin: rinde/RinSim

@Nullable
@Override
public Scenario apply(@Nullable Scenario input) {
 final Scenario in = verifyNotNull(input);
 final Optional<TimeModel.AbstractBuilder<?>> timeModel =
  getTimeModel(in);
 final TimeModel.Builder rtb = TimeModel.builder();
 if (timeModel.isPresent()) {
  rtb.withTickLength(timeModel.get().getTickLength())
   .withTimeUnit(timeModel.get().getTimeUnit());
 }
 return Scenario.builder(in)
  .removeModelsOfType(TimeModel.AbstractBuilder.class)
  .addModel(rtb)
  .build();
}
origin: com.github.rinde/rinsim-scenario

@Override
@Nullable
public Scenario apply(@Nullable Scenario input) {
 final Scenario in = verifyNotNull(input);
 final Optional<TimeModel.AbstractBuilder<?>> timeModel =
  getTimeModel(in);
 RealtimeBuilder rtb = TimeModel.builder()
  .withRealTime()
  .withStartInClockMode(ClockMode.SIMULATED);
 if (timeModel.isPresent()) {
  // copy properties from existing time model
  rtb = rtb.withTickLength(timeModel.get().getTickLength())
   .withTimeUnit(timeModel.get().getTimeUnit());
 }
 // else: in this case we don't copy properties, we use the defaults
 return Scenario.builder(in)
  .removeModelsOfType(TimeModel.AbstractBuilder.class)
  .addModel(rtb)
  .build();
}
origin: rinde/RinSim

@Override
@Nullable
public Scenario apply(@Nullable Scenario input) {
 final Scenario in = verifyNotNull(input);
 final Optional<TimeModel.AbstractBuilder<?>> timeModel =
  getTimeModel(in);
 RealtimeBuilder rtb = TimeModel.builder()
  .withRealTime()
  .withStartInClockMode(ClockMode.SIMULATED);
 if (timeModel.isPresent()) {
  // copy properties from existing time model
  rtb = rtb.withTickLength(timeModel.get().getTickLength())
   .withTimeUnit(timeModel.get().getTimeUnit());
 }
 // else: in this case we don't copy properties, we use the defaults
 return Scenario.builder(in)
  .removeModelsOfType(TimeModel.AbstractBuilder.class)
  .addModel(rtb)
  .build();
}
origin: rinde/RinSim

/**
 * Tests the removal of model builders.
 */
@Test
public void testRemoveModelsOfType() {
 final Scenario.Builder builder = Scenario.builder();
 builder.addModel(TimeModel.builder())
  .addModel(TimeModel.builder().withRealTime())
  .addModel(RoadModelBuilders.plane())
  .addModel(CommModel.builder());
 assertThat(builder.modelBuilders).hasSize(4);
 builder.removeModelsOfType(RoadModelBuilders.PlaneRMB.class);
 assertThat(builder.modelBuilders).hasSize(3);
 assertThat(builder.modelBuilders).containsExactly(TimeModel.builder(),
  TimeModel.builder().withRealTime(), CommModel.builder());
 builder.removeModelsOfType(RoadModelBuilders.AbstractGraphRMB.class);
 builder.removeModelsOfType(TimeModel.AbstractBuilder.class);
 assertThat(builder.modelBuilders).hasSize(1);
 assertThat(builder.modelBuilders).containsExactly(CommModel.builder());
 builder.removeModelsOfType(CommModel.Builder.class);
 assertThat(builder.modelBuilders).isEmpty();
}
origin: rinde/RinSim

.removeModelsOfType(TimeModel.AbstractBuilder.class)
.addModel(TimeModel.builder()
 .withRealTime()
com.github.rinde.rinsim.scenarioScenario$BuilderremoveModelsOfType

Javadoc

Removes all previously added model builders that are an instance of the specified type.

Popular methods of Scenario$Builder

  • build
    Build a new Scenario instance.
  • addEvent
    Add the specified TimedEvent to the builder.
  • addEvents
    Add the specified TimedEvents to the builder.
  • addModel
    Adds the model builder. The builders will be used to instantiate Models needed for the scenario.
  • setStopCondition
  • addModels
    Adds the model builders. The builders will be used to instantiate Models needed for the scenario.
  • clearEvents
    Removes all events.
  • instanceId
    The instance id to use for the next scenario that is created.
  • scenarioLength
  • copyProperties
  • problemClass
    The ProblemClass to use for the next scenario that is created.
  • <init>
  • problemClass,
  • <init>,
  • ensureFrequency,
  • filterEvents,
  • getStopCondition,
  • getTimeWindow,
  • self

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Join (org.hibernate.mapping)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now