/*
 * Copyright 2015 Delft University of Technology
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package nl.tudelft.graphalytics.sequentialjava;

import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.LongList;
import nl.tudelft.graphalytics.Platform;
import nl.tudelft.graphalytics.PlatformExecutionException;
import nl.tudelft.graphalytics.domain.Benchmark;
import nl.tudelft.graphalytics.domain.Graph;
import nl.tudelft.graphalytics.domain.NestedConfiguration;
import nl.tudelft.graphalytics.domain.PlatformBenchmarkResult;

/**
 * Sequential Java implementation of the Graphalytics benchmark.
 *
 * @author Tim Hegeman
 */
public class SequentialJavaPlatform implements Platform {

	private Long2ObjectMap<LongList> graphEdges;

	@Override
	public void uploadGraph(Graph graph) throws Exception {
		graphEdges = new GraphParser(graph).parse();
	}

	@Override
	public PlatformBenchmarkResult executeAlgorithmOnGraph(Benchmark benchmark) throws PlatformExecutionException {
		// TODO
		return null;
	}

	@Override
	public void deleteGraph(String graphName) {
		graphEdges = null;
	}

	@Override
	public String getName() {
		return "sequentialjava";
	}

	@Override
	public NestedConfiguration getPlatformConfiguration() {
		return NestedConfiguration.empty();
	}

}

@@ -894,25 +894,17 @@
 .domain.
-Benchmark
+*
 ;%0Aimport
@@ -939,135 +939,131 @@
 ain.
-Graph;%0Aimport nl.tudelft.graphalytics.domain.NestedConfiguration;%0Aimport nl.tudelft.graphalytics.domain.PlatformBenchmarkResult
+algorithms.BreadthFirstSearchParameters;%0Aimport nl.tudelft.graphalytics.sequentialjava.algorithms.bfs.BreadthFirstSearchJob
 ;%0A%0A/
@@ -1515,29 +1515,413 @@
 %7B%0A%09%09
-// TODO%0A%09%09return null
+Algorithm algorithm = benchmark.getAlgorithm();%0A%09%09Object parameters = benchmark.getAlgorithmParameters();%0A%09%09switch (algorithm) %7B%0A%09%09%09case BFS:%0A%09%09%09%09new BreadthFirstSearchJob(graphEdges, (BreadthFirstSearchParameters)parameters).run();%0A%09%09%09%09break;%0A%09%09%09default:%0A%09%09%09%09throw new PlatformExecutionException(%22Unsupported algorithm: %22 + algorithm);%0A%09%09%7D%0A%09%09return new PlatformBenchmarkResult(getPlatformConfiguration())
 ;%0A%09%7D

Add BFS to executeAlgorithmOnGraph function