Tabnine Logo
Node.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
it.unibo.alchemist.model.interfaces.Node

Best Java code snippets using it.unibo.alchemist.model.interfaces.Node.getId (Showing top 7 results out of 315)

origin: it.unibo.alchemist/alchemist-enginedependentmodel

@Override
public Neighborhood<T> getNeighborhood(@Nonnull final Node<T> center) {
  return neighCache.get(Objects.requireNonNull(center).getId());
}
origin: it.unibo.alchemist/alchemist-swingui

/**
 * 
 * @param x x coord
 * @param y y coord
 */
protected void setDist(final int x, final int y) {
  if (wormhole != null) {
    mousex = x;
    mousey = y;
    final Position envMouse = wormhole.getEnvPoint(new Point(mousex, mousey));
    final StringBuilder sb = new StringBuilder();
    sb.append(envMouse);
    if (nearest != null) {
      sb.append(" -- ");
      sb.append(LocalizedResourceBundle.getString("nearest_node_is"));
      sb.append(": ");
      sb.append(nearest.getId());
    }
    setToolTipText(sb.toString());
  }
}
origin: it.unibo.alchemist/alchemist-enginedependentmodel

private Queue<Operation> recursiveOperation(final Node<T> origin) {
  final Neighborhood<T> newNeighborhood = rule.computeNeighborhood(Objects.requireNonNull(origin), this);
  final Neighborhood<T> oldNeighborhood = neighCache.put(origin.getId(), newNeighborhood);
  return toQueue(origin, oldNeighborhood, newNeighborhood);
}
origin: it.unibo.alchemist/alchemist-incarnation-biochemistry

@Override
public void execute() {
  final Neighborhood<Double> neighborhood = env.getNeighborhood(getNode());
  final List<Integer> validTargetsIds = new ArrayList<>();
  if (delta < 0) {
    neighborhood.getNeighbors().stream()
    .filter(n -> n instanceof CellNode && n.getConcentration(mol) >= delta)
    .mapToInt(n -> n.getId())
    .forEach(i -> validTargetsIds.add(i));
  } else {
    neighborhood.getNeighbors().stream()
    .filter(n -> n instanceof CellNode && n.getConcentration(mol) >= delta)
    .mapToInt(n -> n.getId())
    .forEach(i -> validTargetsIds.add(i));
  }
  if (!validTargetsIds.isEmpty()) {
    final int targetId = validTargetsIds.get(getRandomGenerator().nextInt(validTargetsIds.size()));
    execute(neighborhood.getNeighborByNumber(targetId));
  }
}
origin: it.unibo.alchemist/alchemist-enginedependentmodel

@Override
protected final void nodeRemoved(final Node<T> node, final Position pos) {
  assert node != null;
  /*
   * Neighborhood update
   */
  final Neighborhood<T> neigh = neighCache.remove(node.getId());
  for (final Node<T> n : neigh) {
    neighCache.get(n.getId()).removeNeighbor(node);
  }
  /*
   * Update all the reactions which may have been affected by the node
   * removal
   */
  Engine.nodeRemoved(this, node, neigh);
  /*
   * Call subclass remover
   */
  nodeRemoved(node, neigh);
}
origin: it.unibo.alchemist/alchemist-enginedependentmodel

private Queue<Operation> recursiveOperation(final Node<T> origin, final Node<T> destination, final boolean isAdd) {
  if (isAdd) {
    Engine.neighborAdded(this, origin, destination);
  } else {
    Engine.neighborRemoved(this, origin, destination);
  }
  final Neighborhood<T> newNeighborhood = rule.computeNeighborhood(Objects.requireNonNull(destination), this);
  final Neighborhood<T> oldNeighborhood = neighCache.put(destination.getId(), newNeighborhood);
  return toQueue(destination, oldNeighborhood, newNeighborhood);
}
origin: it.unibo.alchemist/alchemist-enginedependentmodel

final Neighborhood<T> oldNeighborhood = neighCache.put(node.getId(), newNeighborhood);
if (oldNeighborhood != null) {
  final Iterator<Node<T>> iter = oldNeighborhood.iterator();
      final Neighborhood<T> neighborsNeighborhood = neighCache.get(neighbor.getId());
      neighborsNeighborhood.removeNeighbor(node);
      Engine.neighborRemoved(this, node, neighbor);
    neighCache.get(n.getId()).addNeighbor(node);
    Engine.neighborAdded(this, node, n);
final Queue<Operation> operations = recursiveOperation(node);
final TIntSet processed = new TIntHashSet(getNodesNumber());
processed.add(node.getId());
while (!operations.isEmpty()) {
  final Operation next = operations.poll();
  final Node<T> dest = next.destination;
  final int destId = dest.getId();
  if (!processed.contains(destId)) {
    operations.addAll(recursiveOperation(next.origin, next.destination, next.isAdd));
it.unibo.alchemist.model.interfacesNodegetId

Popular methods of Node

  • contains
  • getReactions
  • getConcentration
  • setConcentration
  • compareTo
  • getContents
  • hashCode

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
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