gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31783 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r31783 - gnunet/src/ats
Date: Fri, 3 Jan 2014 14:12:47 +0100

Author: oehlmann
Date: 2014-01-03 14:12:47 +0100 (Fri, 03 Jan 2014)
New Revision: 31783

Modified:
   gnunet/src/ats/plugin_ats_ril.c
Log:
minor softmax eligibility traces fix

Modified: gnunet/src/ats/plugin_ats_ril.c
===================================================================
--- gnunet/src/ats/plugin_ats_ril.c     2014-01-02 23:05:27 UTC (rev 31782)
+++ gnunet/src/ats/plugin_ats_ril.c     2014-01-03 13:12:47 UTC (rev 31783)
@@ -1238,11 +1238,14 @@
 agent_select_softmax (struct RIL_Peer_Agent *agent, double *state)
 {
   int i;
+  int a_max;
   double eqt[agent->n];
   double p[agent->n];
   double sum = 0;
   double r;
 
+  a_max = agent_get_action_best(agent, state);
+
   for (i=0; i<agent->n; i++)
   {
     eqt[i] = exp(agent_estimate_q(agent,state,i) / 
agent->envi->parameters.temperature);
@@ -1261,7 +1264,10 @@
     {
       if (RIL_ALGO_Q == agent->envi->parameters.algorithm)
       {
-        agent_modify_eligibility(agent, RIL_E_UPDATE, NULL, i);
+        if (i == a_max)
+          agent_modify_eligibility(agent, RIL_E_UPDATE, NULL, i);
+        else
+          agent_modify_eligibility(agent, RIL_E_ZERO, NULL, -1);
       }
       return i;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]