]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Include false positive acknowledgements. Adjusted default constants to
authorscipio <scipio>
Mon, 21 May 2007 22:08:29 +0000 (22:08 +0000)
committerscipio <scipio>
Mon, 21 May 2007 22:08:29 +0000 (22:08 +0000)
reduce RAM footprint of noise model.

tos/lib/tossim/CpmModelC.nc
tos/lib/tossim/sim_noise.h

index 5e6b61e1cceeab1f11a4a5e6e5cb0385addf7c9a..59f94e10bbfbac4d264e9cb2767581229baac8c5 100644 (file)
@@ -329,6 +329,19 @@ implementation {
       receiving = 0;
     } // If the packet was lost, then we're searching for new packets again
     else {
+      if (RandomUniform() < 0.001) {
+       dbg("CpmModelC,SNRLoss", "Packet was technically lost, but TOSSIM introduces an ack false positive rate.\n");
+       if (mine->ack && signal Model.shouldAck(mine->msg)) {
+         dbg_clear("CpmModelC", " scheduling ack.\n");
+         sim_gain_schedule_ack(mine->source, sim_time() + 1, mine);
+       }
+       else { // Otherwise free the receive_message_t*
+         free_receive_message(mine);
+       }
+      }
+      else {
+       free_receive_message(mine);
+      }
       receiving = 0;
       dbg_clear("CpmModelC,SNRLoss", "  -packet was lost.\n");
     }
index a46aea9bd8014acfdd5adfe8b852de6447474701..73c9b52cd4147340256f231a209594eda8112f5b 100644 (file)
@@ -48,8 +48,8 @@ enum {
   NOISE_BIN_SIZE = (NOISE_MAX - NOISE_MIN)/NOISE_QUANTIZE_INTERVAL,
   NOISE_HISTORY = 20,
   NOISE_DEFAULT_ELEMENT_SIZE = 8,
-  NOISE_HASHTABLE_SIZE = 8192,
-  NOISE_MIN_TRACE = 1024
+  NOISE_HASHTABLE_SIZE = 128,
+  NOISE_MIN_TRACE = 128
 };
   
 typedef struct sim_noise_hash_t {