public static Score GetStrategy(string name, CustomStratWeights weights) { if (name.Equals("Aggro")) { return(new AggroScore()); } if (name.Equals("Control")) { return(new ControlScore()); } if (name.Equals("Fatigue")) { return(new FatigueScore()); } if (name.Equals("MidRange")) { return(new MidRangeScore()); } if (name.Equals("Ramp")) { return(new RampScore()); } if (name.Equals("Custom")) { return(new CustomScore(weights)); } Console.WriteLine("Strategy " + name + " not a valid strategy."); return(null); }
private void SendWork(string workerInboxPath, Individual cur) { var deckParams = new DeckParams(); deckParams.ClassName = _playerDeck.DeckClass.ToString(); deckParams.CardList = _playerDeck.GetCardNames(); CustomStratWeights weights = cur.GetWeights(); var msg = new PlayMatchesMessage(); msg.Deck = deckParams; msg.Strategy = weights; Toml.WriteFile <PlayMatchesMessage>(msg, workerInboxPath); }
public CustomScore(CustomStratWeights weights) { Weights = weights; }
// Unpack the vector searched by the evolution strategy public CustomStratWeights GetWeights() { return(CustomStratWeights.CreateFromVector(_paramVector)); }
public NeuralNetScore(int[] layerSizes, CustomStratWeights weights) { _network = new FullyConnectedNetwork(layerSizes); _network.SetWeights(weights.Weights); }