private void sARSALAMBDA(State currentState, Strategie strategie) { firstRound(currentState, strategie); //Q(s,a) QValue qValue = strategie.getQValue(lastState, action, qValues); //e(s,a) <- e(s,a)+1 EValue eValue = strategie.getEValue(lastState, action, eValues); //Stacking //--> Replacing: eValue.setValue(1); eValue.setValue(eValue.getValue() + 1); // a ausführen ExecuteAction(qValue.getAction()); // r beobachten reward = getReward(); //s' beobachten currentState = DetermineState(); //Q(s',a') gemäß Strategie QValue currentQValue = strategie.getQValueForStrategie(currentState, qValues); //Tabelle aktualisieren qValues = SARSA_LAMBDA.updateQTable(lastState, lastQValue.getAction(), currentState, currentQValue.getAction(), reward, qValues, eValues); //e(s,a) <- 𝛾𝜆e(s,a) //updateETable --> eValue.setValue(gamma * lambda * eValue.getValue()); eValues = SARSA_LAMBDA.updateETable(lastState, lastQValue.getAction(), currentState, currentQValue.getAction(), eValues); // s<-s', a<-a' lastState = currentState; lastQValue = currentQValue; action = currentQValue.getAction(); }
public Card(EValue value, ESuit suit) { Suit = suit; Value = value; Name = $"{value} of {Suit}"; }
public void Test_SpougeStoE() { var kbp = EValue.Set_Blast_KarlinBlk(0); var gbp = EValue.Set_Blast_GumbelBlk(32767, 32767, 0); var e = EValue.BLAST_SpougeStoE(64, kbp, gbp, 20, 20); var e1 = EValue.BLAST_KarlinStoE_simple(64, kbp, 20); }
void MitigationOptionButton_Click(object sender, RoutedEventArgs e) { b = e.OriginalSource as NewButton; List <EValue> allEValues = ds.EValue(); if (b != null) { string Bid = b.Tag.ToString(); #region check for string match to Button RoutedEventArgs currentMitigationListBox.Items.Add(Bid); EValue evalue = allEValues.FirstOrDefault(j => Bid == j.EName); MitigationSelection.Add(evalue.EName); EValues.Add(evalue.EScore); b.Visibility = Visibility.Collapsed; #endregion } }
/// <summary> /// Used during development of the Wikipedia scraping to examine the scraped data /// </summary> /// <param name="outDir"></param> /// <param name="terms"></param> public void CompileUniqueTerms(string outDir, Terms terms) { foreach (Term t in terms) { List <EValue> evals = new List <Elements.ElementList.EValue>(); foreach (Element e in this) { object o = e.Qualities.ValueOf(t.QualityName); if (o != null) { EValue eval = new EValue(t, e, o); int ndx = evals.BinarySearch(eval); if (ndx < 0) { evals.Insert(~ndx, eval); } } } if (evals.Count > 0) { evals.Sort(delegate(EValue ex, EValue ey) { return(Comparer <int> .Default.Compare(ex.Number, ey.Number)); }); string fpath = Path.Combine(outDir, t.QualityName + ".txt"); using (FileStream fs = File.OpenWrite(fpath)) { using (StreamWriter w = new StreamWriter(fs)) { foreach (EValue ev in evals) { w.WriteLine(ev.ToString()); } } } //fpath = Path.Combine(outDir, "Units.txt"); //Qualities.WriteUnitsCode(fpath); } } }
private bool h_CheckCells(List <Cell> arCells) { EValue enV = EValue.Unknown; foreach (var pCell in arCells) { if (enV == EValue.Unknown) { enV = pCell.Value; continue; } if (enV != pCell.Value) { return(false); } } if (enV == EValue.Empty) { return(false); } return(true); }
private static int Heuristic(EValue[] board) { EValue[,] _board = new EValue[, ] { { board[0], board[1], board[2] }, { board[3], board[4], board[5] }, { board[6], board[7], board[8] }, }; for (int i = 0; i < 3; i++) { if (_board[i, 0] == _board[i, 1] && _board[i, 1] == _board[i, 2]) { if (_board[i, 0] == EValue.O) { return(10); } else if (_board[i, 0] == EValue.X) { return(-10); } } } for (int j = 0; j < 3; j++) { if (_board[0, j] == _board[1, j] && _board[1, j] == _board[2, j]) { if (_board[0, j] == EValue.O) { return(10); } else if (_board[0, j] == EValue.X) { return(-10); } } } if (_board[0, 0] == _board[1, 1] && _board[1, 1] == _board[2, 2]) { if (_board[0, 0] == EValue.O) { return(10); } else if (_board[0, 0] == EValue.X) { return(-10); } } if (_board[0, 2] == _board[1, 1] && _board[1, 1] == _board[2, 0]) { if (_board[0, 2] == EValue.O) { return(10); } else if (_board[0, 2] == EValue.X) { return(-10); } } return(0); }
//解密 public static double LuaDecryptDES(double value) { double EnValue = BitConverter.ToDouble(EValue.DecryptDES(BitConverter.GetBytes(value)), 0); return(EnValue); }
public Card(ESuit mSuit, EValue mValue) { Suit = mSuit; Value = mValue; Initialize(); }
public Card(ESuit enSuit, EValue enValue) { Suit = enSuit; Value = enValue; }
public Card(ESuits s, EValue v) { suit = s; value = v; }