Tabnine Logo
Environment.getNodes
Code IndexAdd Tabnine to your IDE (free)

How to use
getNodes
method
in
it.unibo.alchemist.model.interfaces.Environment

Best Java code snippets using it.unibo.alchemist.model.interfaces.Environment.getNodes (Showing top 3 results out of 315)

origin: it.unibo.alchemist/alchemist-engine

private void finalizeConstructor() {
  for (final Node<T> n : env.getNodes()) {
    for (final Reaction<T> r : n.getReactions()) {
      scheduleReaction(r);
    }
  }
}
origin: it.unibo.alchemist/alchemist-swingui

@Override
public void optimalZoom() {
  byte zoom = MAX_ZOOM;
  @SuppressWarnings("unchecked")
  final Environment<Object> env = (Environment<Object>) getEnvironment();
  do {
    setZoom(zoom);
    zoom--;
  } while (zoom > 1 && !env.getNodes().parallelStream()
      .map(env::getPosition)
      .map(this::getViewPoint)
      .allMatch(this::isInsideView));
}
origin: it.unibo.alchemist/alchemist-swingui

private void update(final Environment<T> env, final Time time) {
  if (Thread.holdsLock(env)) {
    if (envHasMobileObstacles(env)) {
      loadObstacles(env);
    }
    lasttime = time.toDouble();
    currentEnv = env;
    accessData();
    positions.clear();
    neighbors.clear();
    env.getNodes().parallelStream().forEach(node -> {
      positions.put(node, env.getPosition(node));
      try {
        neighbors.put(node, env.getNeighborhood(node).clone());
      } catch (Exception e) {
        L.error("Unable to clone neighborhood for " + node, e);
      }
    });
    releaseData();
    repaint();
  } else {
    throw new IllegalStateException("Only the simulation thread can dictate GUI updates");
  }
}
it.unibo.alchemist.model.interfacesEnvironmentgetNodes

Popular methods of Environment

  • getNeighborhood
  • getPosition
  • getDistanceBetweenNodes
  • getSimulation
  • getLayer
  • getNodeByID
  • getOffset
  • getSize
  • isTerminated
  • removeNode
  • setSimulation
  • setSimulation

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • String (java.lang)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top PhpStorm plugins
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