shortest path
This commit is contained in:
parent
edd931bca5
commit
7d33d11a03
@ -67,14 +67,12 @@ public class Server
|
|||||||
{
|
{
|
||||||
DateTime start = DateTime.Now;
|
DateTime start = DateTime.Now;
|
||||||
HashSet<string> allFiles = Directory.GetFiles(directory).Where(file => file.EndsWith(".result")).ToHashSet();
|
HashSet<string> allFiles = Directory.GetFiles(directory).Where(file => file.EndsWith(".result")).ToHashSet();
|
||||||
PathResult first = PathResult.PathresultFromFile(allFiles.First());
|
Dictionary<PathResult, string> results = new();
|
||||||
KeyValuePair<PathResult, string> shortest = new(first, allFiles.First());
|
|
||||||
KeyValuePair<PathResult, string> fastest = new(first, allFiles.First());
|
|
||||||
KeyValuePair<PathResult, string> calcTime = new(first, allFiles.First());
|
|
||||||
int loaded = 0;
|
int loaded = 0;
|
||||||
foreach (string filePath in allFiles)
|
foreach (string filePath in allFiles)
|
||||||
{
|
{
|
||||||
PathResult result = PathResult.PathresultFromFile(filePath);
|
PathResult result = PathResult.PathresultFromFile(filePath);
|
||||||
|
results.Add(result, filePath);
|
||||||
Console.WriteLine($"{loaded++}/{allFiles.Count()} {filePath} " +
|
Console.WriteLine($"{loaded++}/{allFiles.Count()} {filePath} " +
|
||||||
$"Time elapsed: {DateTime.Now - start} " +
|
$"Time elapsed: {DateTime.Now - start} " +
|
||||||
$"Remaining {((DateTime.Now - start)/loaded)*(allFiles.Count-loaded)}");
|
$"Remaining {((DateTime.Now - start)/loaded)*(allFiles.Count-loaded)}");
|
||||||
|
Reference in New Issue
Block a user