Skip to content
Snippets Groups Projects
Commit 70140290 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed NPE

parent 2e2fc1fe
No related branches found
No related tags found
No related merge requests found
......@@ -37,10 +37,14 @@ public abstract class Isochrone {
* Instantiates a new isochrone object.
*
* @param query The parameters for the isochrone
* @throws AlgorithmException thrown if there are no date codes in the databse for the specified query
*/
public Isochrone(final Query query) {
public Isochrone(final ConfigDataset config, final Query query) throws AlgorithmException {
this.query = query;
queue = new PriorityQueue<Node>();
this.db = new Database<>(config, query.getMode(), query.getDir());
this.queue = new PriorityQueue<Node>();
initDateCodes();
}
/**
......
package it.unibz.inf.isochrone.algorithm;
import it.unibz.inf.isochrone.config.ConfigDataset;
import it.unibz.inf.isochrone.db.Database;
import it.unibz.inf.isochrone.network.Link;
import it.unibz.inf.isochrone.network.Node;
import it.unibz.inf.isochrone.util.Query;
......@@ -23,10 +22,8 @@ public class MDijkstra extends Isochrone {
private final Map<Integer, Link> links;
public MDijkstra(final ConfigDataset config, final Query query) throws AlgorithmException {
super(query);
super(config, query);
initDateCodes();
db = new Database<>(config, query.getMode(), query.getDir());
nodes = new HashMap<Integer, Node>();
links = new LinkedHashMap<Integer, Link>();
......
package it.unibz.inf.isochrone.algorithm;
import it.unibz.inf.isochrone.config.ConfigDataset;
import it.unibz.inf.isochrone.db.Database;
import it.unibz.inf.isochrone.network.Link;
import it.unibz.inf.isochrone.network.Node;
import it.unibz.inf.isochrone.util.Query;
......@@ -18,10 +17,8 @@ public class MineX extends Isochrone {
private final Map<Integer, Node> nodes;
public MineX(final ConfigDataset config, final Query query) throws AlgorithmException {
super(query);
super(config, query);
initDateCodes();
db = new Database<>(config, query.getMode(), query.getDir());
nodes = new HashMap<Integer, Node>();
}
......
package it.unibz.inf.isochrone.algorithm;
import it.unibz.inf.isochrone.config.ConfigDataset;
import it.unibz.inf.isochrone.db.Database;
import it.unibz.inf.isochrone.network.Link;
import it.unibz.inf.isochrone.network.Node;
import it.unibz.inf.isochrone.util.DistanceAlgorithm;
......@@ -33,10 +32,8 @@ public class MrneX extends Isochrone {
}
public MrneX(final ConfigDataset config, final Query query, final int maxMemorySize) throws AlgorithmException {
super(query);
super(config, query);
initDateCodes();
db = new Database<>(config, query.getMode(), query.getDir());
maxDuration = query.getDuration().intValue();
maxMemory = maxMemorySize;
nodes = new HashMap<Integer, Node>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment