cc-routing / routing-sara

Seznam Advanced Routing Algorithm
1 stars 2 forks source link

Implement tester #2

Open blahami2 opened 8 years ago

blahami2 commented 8 years ago

Implement testing environment for the parametrization evaluation - evaluate and compare several patameter setups (automatically with large data)

Update

blahami2 commented 8 years ago
blahami2 commented 8 years ago
  1. Determine goals
    • What is the best result?
    • The lowest cut edge amount -> single partition
    • The fastest Dijkstra inside a partition -> single node in a partition
    • Probably create a size limit based on time requirements and then create partitions roughly of that size
  2. Design and implements result format
  3. Design and implement result export tools
  4. Determine ranges and increments
  5. Implement runtime environment
    • Get settings
    • Run for the obtained settings
    • Save result (table, plot)
    • Increment and repeat
  6. Export an overall result
  7. Report
blahami2 commented 8 years ago

Settings

Default

blahami2 commented 8 years ago

:white_check_mark: Determine goals :white_check_mark: Design and implements result format :white_check_mark: Design and implement result export tools (table) ✅ Design and implement result export tools (plot) :white_check_mark: Determine ranges and increments :white_check_mark: Implement runtime environment :white_check_mark: Get settings :white_check_mark: Run for the obtained settings :white_check_mark: Save result (table) ❌ Save result (plot) :white_check_mark: Increment and repeat :white_check_mark: Export an overall result (table) :x: Export an overall result (plot) :white_check_mark: Report

blahami2 commented 8 years ago

Update

✅ Create dataset ✅ Design result format (for comparison) ✅ Find routes using regular Dijkstra ✅ Add multilevel Dijkstra to testing (for each set of parameters, run Dijkstra on dataset, log results) ✅ Compare route-search times and consider them as another quality measurement

blahami2 commented 8 years ago

Update

:white_check_mark: Define plot output :x: Create table for each plot :x: Export

blahami2 commented 8 years ago

Plot output

Cell size

Cell reatio

X; X from |Settings|

blahami2 commented 8 years ago

MLD usage

public static void demo() {

        OverlayCreator creator = new OverlayCreator();
        OverlayCreator.SaraSetup setup = creator.setup;

        setup.spatialModulePath = "c:/ProgWin/SqLite64/mod_spatialite.dll";
        setup.dbFolder = "D:/";
        setup.setRandomSeed(123);
        setup.layerCount = 5;
        setup.maxCellSize = 20;
        setup.numberOfAssemblyRuns = 1;

       // D://prog-20-5.sqlite
        setup.dbName = "prg-20-5"; //L3

        // punch and save
        //setup.runPunch = true;

       //no punch, load only
        setup.runPunch = false;

        OverlayBuilder builder = creator.createBuilder();
        builder.buildOverlays();

        SaraGraph sara = builder.graph;

        DijkstraAlgorithm oneAlg = new DijkstraAlgorithm();
        MultilevelDijkstraAlgorithm mldAlg = new MultilevelDijkstraAlgorithm();

        long sourceId = 27793;
        long targetId = 28194;
        SaraNode source = sara.getNodeById(sourceId);
        SaraNode target = sara.getNodeById(targetId);

        Optional<Route<SaraNode, SaraEdge>> oneRoute
                = oneAlg.route(sara, Metric.LENGTH, source, target);

        MLDRecursiveRouteUnpacker unpacker = new MLDRecursiveRouteUnpacker();
        Optional<Route<SaraNode, SaraEdge>> mldRoute
                = mldAlg.route(sara, builder, Metric.LENGTH, source, target, unpacker);

        // 114 edges expected
        System.out.println("one=" + oneRoute.get().getEdgeList().size());
        System.out.println("mld=" + mldRoute.get().getEdgeList().size());
    }