/// <summary>
/// Constructor
/// </summary>
public FrontierSet(TraversalInfo startState)
{
if (!ZingerConfiguration.FrontierToDisk)
{
InMemoryCurrentGlobalFrontier = new ConcurrentQueue<FrontierNode>();
InMemoryNextGlobalFrontier = new ConcurrentDictionary<Fingerprint, FrontierNode>();
InMemoryNextGlobalFrontier.TryAdd(startState.Fingerprint, new FrontierNode(startState));
}
else
{
currFrontierSet = new BlockingCollection<FrontierNode>(bufferSize);
nextFrontierSet = new BlockingCollection<KeyValuePair<Fingerprint, FrontierNode>>(2 * bufferSize);
nextFrontierSetHT = new HashSet<Fingerprint>();
readerWorkers = new Task[numOfRWThreads];
writerWorkers = new Task[numOfRWThreads];
counter = 0;
currFrontierSet.Add(new FrontierNode(startState));
for (int i = 0; i < numOfRWThreads; i++)
{
File.Delete("i_" + i.ToString());
File.Delete("o_" + i.ToString());
}
//put the start frontier onto disk
var startFrontier = new FrontierNode(startState);
Stream writeStream = File.Open("o_0", FileMode.Create);
startFrontier.Serialize(writeStream);
writeStream.Close();
}
}