Tabnine Logo
BinaryMinHeap.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.matsim.core.router.priorityqueue.BinaryMinHeap
constructor

Best Java code snippets using org.matsim.core.router.priorityqueue.BinaryMinHeap.<init> (Showing top 8 results out of 315)

origin: matsim-org/matsim

public WrappedBinaryMinHeap(int maxSize, int fanout, boolean classicalRemove) {
  this.delegate = new BinaryMinHeap<>(maxSize, fanout, classicalRemove);
  this.map = new IdentityHashMap<>(maxSize);
}

origin: matsim-org/matsim

public WrappedBinaryMinHeap(int maxSize) {
  this.delegate = new BinaryMinHeap<>(maxSize);
  this.map = new IdentityHashMap<>(maxSize);
}

origin: matsim-org/matsim

private MinHeap<HasIndex> createMinHeap(boolean classicalRemove) {
  MinHeap<HasIndex> pq = new BinaryMinHeap<HasIndex>(maxElements, BinaryMinHeap.defaultFanout, classicalRemove);
  return pq;
}
origin: matsim-org/matsim

  @Override
  /*package*/ RouterPriorityQueue<? extends Node> createRouterPriorityQueue() {
    /*
     * Re-use existing BinaryMinHeap instead of creating a new one. For large networks (> 10^6 nodes and links) this reduced
     * the computation time by 40%! cdobler, oct'15
     */
    if (this.routingNetwork instanceof ArrayRoutingNetwork) {
      int size = this.routingNetwork.getNodes().size();
      if (this.heap == null || this.maxSize != size) {
        this.maxSize = size;
        this.heap = new BinaryMinHeap<>(maxSize);
        return this.heap;
      } else {
        this.heap.reset();
        return this.heap;
      }
//            int maxSize = this.routingNetwork.getNodes().size();
//            return new BinaryMinHeap<ArrayRoutingNetworkNode>(maxSize);
    } else {
      return super.createRouterPriorityQueue();
    }
  }
   
origin: matsim-org/matsim

@Override
/*package*/ RouterPriorityQueue<? extends Node> createRouterPriorityQueue() {
  /*
   * Re-use existing BinaryMinHeap instead of creating a new one. For large networks (> 10^6 nodes and links) this reduced
   * the computation time by 40%! cdobler, oct'15
   */
  if (this.routingNetwork instanceof ArrayRoutingNetwork) {
    int size = this.routingNetwork.getNodes().size();
    if (this.heap == null || this.maxSize != size) {
      this.maxSize = size;
      this.heap = new BinaryMinHeap<>(maxSize);
      return this.heap;
    } else {
      this.heap.reset();
      return this.heap;
    }
  } else {
    return super.createRouterPriorityQueue();
  }
}
 
origin: matsim-org/matsim

  @Override
  /*package*/ RouterPriorityQueue<? extends Node> createRouterPriorityQueue() {
    /*
     * Re-use existing BinaryMinHeap instead of creating a new one. For large networks (> 10^6 nodes and links) this reduced
     * the computation time by 40%! cdobler, oct'15
     */
    if (this.routingNetwork instanceof ArrayRoutingNetwork) {
      int size = this.routingNetwork.getNodes().size();
      if (this.heap == null || this.maxSize != size) {
        this.maxSize = size;
        this.heap = new BinaryMinHeap<>(maxSize);
        return this.heap;
      } else {
        this.heap.reset();
        return this.heap;
      }
//            int maxSize = this.routingNetwork.getNodes().size();
//            return new BinaryMinHeap<ArrayRoutingNetworkNode>(maxSize);
    } else {
      return super.createRouterPriorityQueue();
    }
  }
   
origin: matsim-org/matsim

  @Override
  /*package*/ RouterPriorityQueue<? extends Node> createRouterPriorityQueue() {
    /*
     * Re-use existing BinaryMinHeap instead of creating a new one. For large networks (> 10^6 nodes and links) this reduced
     * the computation time by 40%! cdobler, oct'15
     */
    if (this.routingNetwork instanceof ArrayRoutingNetwork) {
      int size = this.routingNetwork.getNodes().size();
      if (this.heap == null || this.maxSize != size) {
        this.maxSize = size;
        this.heap = new BinaryMinHeap<>(maxSize);
        return this.heap;
      } else {
        this.heap.reset();
        return this.heap;
      }
//            int maxSize = this.routingNetwork.getNodes().size();
//            return new BinaryMinHeap<ArrayRoutingNetworkNode>(maxSize);
    } else {
      return super.createRouterPriorityQueue();
    }
  }
   
origin: matsim-org/matsim

public PointingAgent(
    final Person person,
    final ReplanningGroup group,
    final WeightCalculator weight) {
  this.id = person.getId();
  this.records = new PlanRecord[ person.getPlans().size() ];
  this.heap = new BinaryMinHeap<>( records.length );
  int i = 0;
  for ( Plan p : person.getPlans() ) {
    records[ i ] =
      new PlanRecord(
          this,
          p,
          weight.getWeight(
            p,
            group ),
          // this is used by the binary heap to be efficient:
          // it asks the user to set the index of the element in the
          // internal array by himself.
          i);
    final boolean added =
      this.heap.add(
        records[ i ],
        // inverse priority: we want decreasing order
        -records[ i ].getWeight() );
    if ( !added ) throw new RuntimeException();
    i++;
  }
}
org.matsim.core.router.priorityqueueBinaryMinHeap<init>

Popular methods of BinaryMinHeap

  • add
    Adds the specified element to this priority queue, with the given priority. If the element is alread
  • copyData
  • decreaseKey
    Increases the priority (=decrease the given double value) of the element. If the element ins not par
  • getIndex
  • getLeftChildIndex
  • getParentIndex
  • isEmpty
    Checks whether the queue is empty.
  • iterator
    Returns an iterator over the elements in this queue. The iterator does NOT return the elements sorte
  • peek
  • poll
    Retrieves and removes the head of this queue, or null if this queue is empty.
  • remove
    Removes a single instance of the specified element from this queue, if it is present.
  • removeSiftDown
  • remove,
  • removeSiftDown,
  • reset,
  • siftDown,
  • siftDownUp,
  • siftUp,
  • size,
  • swapData

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • JList (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now