public SolutionService(ISolutionCache <TSolution> solutionCache, ISolutionSet <TSolution> solutionSet, ISolutionValidator <TSolution> validator, SolutionServiceConfiguration configuration) { SolutionCache = solutionCache; SolutionSet = solutionSet; SolutionValidator = validator; Configuration = configuration; }
public string[] GetSolutionNamesForSet(string set) { ISolutionSet solutionSet = null; solutionSets.TryGetValue(set, out solutionSet); if (solutionSet == null) { Debug.LogError("Could not find set named " + set); } return(solutionSet.GetSolutionNames()); }
// Direct retrieval of a specific solution given a setname and solution name public bool GetData(string setName, string name, ref double[,] x, ref double[,] v, ref GravityEngine.Algorithm algorithm, ref float scale) { // check everything (will support search someday?) ISolutionSet solutionSet = null; if (!solutionSets.TryGetValue(setName, out solutionSet)) { return(false); } if (solutionSet != null) { // Debug.Log ("Load set=" + setName + " soln=" + name); return(solutionSet.GetDataForSolutionName(name, ref x, ref v, ref algorithm, ref scale)); } Debug.LogError("Did not find solution=" + name); return(false); }