diff_rate.h File Reference

#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <signal.h>
#include <float.h>
#include <stdlib.h>
#include <tcl.h>
#include "diff_header.h"
#include "agent.h"
#include "tclcl.h"
#include "ip.h"
#include "config.h"
#include "packet.h"
#include "trace.h"
#include "random.h"
#include "classifier.h"
#include "node.h"
#include "iflist.h"
#include "hash_table.h"
#include "arp.h"
#include "mac.h"
#include "ll.h"
#include "dsr/path.h"

Include dependency graph for diff_rate.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  DiffusionRate
class  GradientTimer
class  NegativeReinforceTimer

Defines

#define INTEREST_PERIODIC   5
#define INTEREST_TIMEOUT   15
#define MAX_DUP_DATA   0
#define MAX_NEG_COUNTER   20
#define NEG_CHECK   2.0
#define NEG_MIN_RATIO   0.1
#define PER_IIF   5

Typedefs

typedef enum neg_max_counter_type__ neg_mxt
typedef enum neg_threshold_type__ neg_tht
typedef enum neg_window_type__ neg_wint
typedef enum original_tx_type__ org_t
typedef enum pos_reinf_node_type__ pos_ndt
typedef enum pos_reinf_type__ pos_t
typedef enum subsample_tx_type__ sub_t

Enumerations

enum  neg_max_counter_type__ { NEG_FIXED_MAX, NEG_SCALE_MAX }
enum  neg_threshold_type__ { NEG_ABSOLUTE, NEG_RELATIVE }
enum  neg_window_type__ { NEG_COUNTER, NEG_TIMER }
enum  original_tx_type__ { BCAST_ORG, UNICAST_ORG }
enum  pos_reinf_node_type__ { END_POS, INTM_POS }
enum  pos_reinf_type__ { POS_HASH, POS_LAST, POS_ALL }
enum  subsample_tx_type__ { BCAST_SUB, UNICAST_SUB }

Functions

neg_mxt ParseNegMaxType (const char *str)
neg_tht ParseNegThrType (const char *str)
neg_wint ParseNegWinType (const char *str)
org_t ParseOrgType (const char *str)
pos_ndt ParsePosNodeType (const char *str)
pos_t ParsePosType (const char *str)
sub_t ParseSubType (const char *str)


Define Documentation

#define INTEREST_PERIODIC   5
 

Definition at line 134 of file diff_rate.h.

Referenced by SinkAgent::bcast_interest(), Diff_Routing_Entry::Diff_Routing_Entry(), DiffusionRate::InterestHandle(), and Diff_Routing_Entry::reset().

#define INTEREST_TIMEOUT   15
 

Definition at line 135 of file diff_rate.h.

Referenced by DiffusionRate::InterestHandle(), DiffusionRate::ProcessPosReinf(), and DiffusionRate::Start().

#define MAX_DUP_DATA   0
 

Definition at line 142 of file diff_rate.h.

Referenced by DiffusionRate::GenNeg().

#define MAX_NEG_COUNTER   20
 

Definition at line 138 of file diff_rate.h.

Referenced by DiffusionRate::CheckNegCounter().

#define NEG_CHECK   2.0
 

Definition at line 137 of file diff_rate.h.

Referenced by DiffusionRate::Start().

#define NEG_MIN_RATIO   0.1
 

Definition at line 141 of file diff_rate.h.

#define PER_IIF   5
 

Definition at line 139 of file diff_rate.h.

Referenced by DiffusionRate::CheckNegCounter().


Typedef Documentation

typedef enum neg_max_counter_type__ neg_mxt
 

typedef enum neg_threshold_type__ neg_tht
 

typedef enum neg_window_type__ neg_wint
 

typedef enum original_tx_type__ org_t
 

typedef enum pos_reinf_node_type__ pos_ndt
 

typedef enum pos_reinf_type__ pos_t
 

typedef enum subsample_tx_type__ sub_t
 


Enumeration Type Documentation

enum neg_max_counter_type__
 

Enumerator:
NEG_FIXED_MAX 
NEG_SCALE_MAX 

Definition at line 128 of file diff_rate.h.

00128                                     {
00129   NEG_FIXED_MAX,
00130   NEG_SCALE_MAX
00131 } neg_mxt;

enum neg_threshold_type__
 

Enumerator:
NEG_ABSOLUTE 
NEG_RELATIVE 

Definition at line 119 of file diff_rate.h.

00119                                   {
00120   NEG_ABSOLUTE,
00121   NEG_RELATIVE
00122 } neg_tht;

enum neg_window_type__
 

Enumerator:
NEG_COUNTER 
NEG_TIMER 

Definition at line 110 of file diff_rate.h.

00110                                {
00111   NEG_COUNTER,
00112   NEG_TIMER
00113 } neg_wint;

enum original_tx_type__
 

Enumerator:
BCAST_ORG 
UNICAST_ORG 

Definition at line 91 of file diff_rate.h.

00091                                 {
00092   BCAST_ORG,
00093   UNICAST_ORG
00094 } org_t;

enum pos_reinf_node_type__
 

Enumerator:
END_POS 
INTM_POS 

Definition at line 104 of file diff_rate.h.

00104                                    {
00105   END_POS,
00106   INTM_POS
00107 } pos_ndt;

enum pos_reinf_type__
 

Enumerator:
POS_HASH 
POS_LAST 
POS_ALL 

Definition at line 97 of file diff_rate.h.

00097                               {
00098   POS_HASH,
00099   POS_LAST,
00100   POS_ALL
00101 } pos_t;

enum subsample_tx_type__
 

Enumerator:
BCAST_SUB 
UNICAST_SUB 

Definition at line 85 of file diff_rate.h.

00085                                  {
00086   BCAST_SUB,
00087   UNICAST_SUB
00088 } sub_t;


Function Documentation

neg_mxt ParseNegMaxType const char *  str  ) 
 

Definition at line 1161 of file diff_rate.cc.

References NEG_FIXED_MAX, and NEG_SCALE_MAX.

Referenced by DiffusionRate::command().

01162 {
01163   if (strcasecmp(str, "FIXED") == 0) {
01164     return NEG_FIXED_MAX;
01165   }
01166 
01167   if (strcasecmp(str, "SCALE") == 0) {
01168     return NEG_SCALE_MAX;
01169   }
01170 
01171   fprintf(stderr,"ParseNegMaxType Error -- Only FIXED or SCALE\n");
01172   exit(-1);
01173 }

neg_tht ParseNegThrType const char *  str  ) 
 

Definition at line 1146 of file diff_rate.cc.

References NEG_ABSOLUTE, and NEG_RELATIVE.

Referenced by DiffusionRate::command().

01147 {
01148   if (strcasecmp(str, "ABSOLUTE") == 0) {
01149     return NEG_ABSOLUTE;
01150   }
01151 
01152   if (strcasecmp(str, "RELATIVE") == 0) {
01153     return NEG_RELATIVE;
01154   }
01155 
01156   fprintf(stderr,"ParseNegThrType Error -- Only ABSOLUTE or RELATIVE\n");
01157   exit(-1);
01158 }

neg_wint ParseNegWinType const char *  str  ) 
 

Definition at line 1131 of file diff_rate.cc.

References NEG_COUNTER, and NEG_TIMER.

Referenced by DiffusionRate::command().

01132 {
01133   if (strcasecmp(str, "COUNTER") == 0) {
01134     return NEG_COUNTER;
01135   }
01136 
01137   if (strcasecmp(str, "TIMER") == 0) {
01138     return NEG_TIMER;
01139   }
01140 
01141   fprintf(stderr,"ParseNegWinType Error -- Only COUNTER or TIMER\n");
01142   exit(-1);
01143 }

org_t ParseOrgType const char *  str  ) 
 

Definition at line 1082 of file diff_rate.cc.

References BCAST_ORG, and UNICAST_ORG.

Referenced by DiffusionRate::command().

01083 {
01084   if (strcasecmp(str, "BROADCAST") == 0) {
01085     return BCAST_ORG;
01086   }
01087 
01088   if (strcasecmp(str, "UNICAST") == 0) {
01089     return UNICAST_ORG;
01090   }
01091 
01092   fprintf(stderr,"ParseOrgType Error -- Only BROADCAST or UNICAST\n");
01093   exit(-1);
01094 }

pos_ndt ParsePosNodeType const char *  str  ) 
 

Definition at line 1116 of file diff_rate.cc.

References END_POS, and INTM_POS.

Referenced by DiffusionRate::command().

01117 {
01118   if (strcasecmp(str, "END") == 0) {
01119     return END_POS;
01120   }
01121 
01122   if (strcasecmp(str, "INTM") == 0) {
01123     return INTM_POS;
01124   }
01125 
01126   fprintf(stderr,"ParsePosNodeType Error -- Only END or INTM\n");
01127   exit(-1);
01128 }

pos_t ParsePosType const char *  str  ) 
 

Definition at line 1097 of file diff_rate.cc.

References POS_ALL, POS_HASH, and POS_LAST.

Referenced by DiffusionRate::command().

01098 {
01099   if (strcasecmp(str, "HASH") == 0) {
01100     return POS_HASH;
01101   }
01102 
01103   if (strcasecmp(str, "LAST") == 0) {
01104     return POS_LAST;
01105   }
01106 
01107   if (strcasecmp(str, "ALL") == 0) {
01108     return POS_ALL;
01109   }
01110 
01111   fprintf(stderr,"ParsePosType Error -- Only HASH, LAST, or ALL\n");
01112   exit(-1);
01113 }

sub_t ParseSubType const char *  str  ) 
 

Definition at line 1066 of file diff_rate.cc.

References BCAST_SUB, and UNICAST_SUB.

Referenced by DiffusionRate::command().

01067 {
01068   if (strcasecmp(str, "BROADCAST") == 0) {
01069     return BCAST_SUB;
01070   }
01071 
01072   if (strcasecmp(str, "UNICAST") == 0) {
01073     return UNICAST_SUB;
01074   }
01075 
01076   fprintf(stderr,"ParseSubType Error -- Only BROADCAST or UNICAST\n");
01077   exit(-1);
01078 }


Generated on Tue Mar 6 16:51:58 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6