Beispiel #1
0
        private static void Evaluate(ITrainable classifier)
        {
            classifier.Train(trainingSet);

            var serializer = new JsonSerializer(classifier);

            serializer.SerializeTo(classifier + ".json");

            var benchmark = new Benchmark(classifier, testSet);

            Console.WriteLine(benchmark.Report());
        }
Beispiel #2
0
    // Commands
    public void TrainCommand(string identifier)
    {
        if (ResourceManager.instance.resources.IsSufficient(Utils.unitCostTable[identifier]))
        {
            AudioController.instance.PlaySingle("training");
            ResourceManager.instance.resources.Reduce(Utils.unitCostTable[identifier]);
            ITrainable trainer = Selection.instance.selectedEntities.Values.First().GetComponent <ITrainable>();
            trainer.Train(identifier);
        }
        else
        {
            AudioController.instance.PlaySingle("insufficient funds");
        }
//		if(identifier == "Villager")
//		{
//			MainBuilding building = SelectionController00.instance.selectedEntities.Values.First().GetComponent<MainBuilding>();
//			building.AddTrainingQueueu();
//		}
    }