Tabnine Logo
Reaction.getInputContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getInputContext
method
in
it.unibo.alchemist.model.interfaces.Reaction

Best Java code snippets using it.unibo.alchemist.model.interfaces.Reaction.getInputContext (Showing top 4 results out of 315)

origin: it.unibo.alchemist/alchemist-engine

private void updateNeighborhood(final Node<T> n) {
  for (final Reaction<T> r : n.getReactions()) {
    if (r.getInputContext().equals(Context.NEIGHBORHOOD)) {
      updateReaction(handlers.get(r));
    }
  }
}
origin: it.unibo.alchemist/alchemist-engine

private void updateDependenciesForOperationOnNode(final Neighborhood<T> oldNeighborhood) {
  /*
   * A reaction in the neighborhood may have changed due to the content of
   * this new node. Must check.
   */
  for (final Node<T> n : oldNeighborhood) {
    for (final Reaction<T> r : n.getReactions()) {
      if (r.getInputContext().equals(Context.NEIGHBORHOOD)) {
        updateReaction(handlers.get(r));
      }
    }
  }
  /*
   * It is possible that some global reaction is changed due to the
   * creation of a new node. Checking.
   */
  for (final Node<T> n : env) {
    for (final Reaction<T> r : n.getReactions()) {
      if (r.getInputContext().equals(Context.GLOBAL)) {
        updateReaction(handlers.get(r));
      }
    }
  }
}
origin: it.unibo.alchemist/alchemist-engine

private boolean mayInfluence(final Reaction<T> source, final Reaction<T> target) {
  final Context in = target.getInputContext();
  final Context out = source.getOutputContext();
  if (// Same node
  target.getNode().equals(source.getNode())
  // If reaction writes something globally
      || out.equals(Context.GLOBAL)
      // If reaction reads something globally
      || in.equals(Context.GLOBAL)) {
    return true;
  }
  return influenceNeighborCheck(env, source, target, in, out);
}
origin: it.unibo.alchemist/alchemist-engine

private void createDependencies(final DependencyHandler<T> newHandler, final Reaction<T> newReaction) {
  /*
   * Will contain the reactions potentially influencing the new one
   */
  final Iterable<Reaction<T>> inputCandidates = initCandidates(newReaction, newReaction.getInputContext());
  /*
   * Will contain the reactions possibly influenced by the new one
   */
  final Iterable<Reaction<T>> outputCandidates = initCandidates(newReaction, newReaction.getOutputContext());
  /*
   * keySet() is not guaranteed to preserve the ordering. This can lead to
   * bad behaviors, since may change the order by which the reactions are
   * updated, and consequently ruin the predictability
   */
  for (final Reaction<T> r : inputCandidates) {
    if (mayInfluence(r, newReaction) && influences(r, newReaction.getInfluencingMolecules())) {
      final DependencyHandler<T> dep = hndlrs.get(r);
      dep.addOutDependency(newHandler);
      newHandler.addInDependency(dep);
    }
  }
  for (final Reaction<T> r : outputCandidates) {
    if (mayInfluence(newReaction, r) && influences(newReaction, r.getInfluencingMolecules())) {
      final DependencyHandler<T> dep = hndlrs.get(r);
      newHandler.addOutDependency(dep);
      dep.addInDependency(newHandler);
    }
  }
}
it.unibo.alchemist.model.interfacesReactiongetInputContext

Popular methods of Reaction

  • getNode
  • getTau
  • setActions
  • setConditions
  • canExecute
  • cloneOnNewNode
  • execute
  • getActions
  • getConditions
  • getInfluencedMolecules
  • getInfluencingMolecules
  • getOutputContext
  • getInfluencingMolecules,
  • getOutputContext,
  • getRate,
  • initializationComplete,
  • update

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • findViewById (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Sublime Text 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