Revision b6158841

View differences:

setup.ini
1
# Impact of Mobility Model
2

  
3
[base]
4
duration = 1000s
5
mobility_timer = 1s
6
max_x = 100
7
max_y = 100
8
velocity = pedestrian
9
radius = 30.0
10
nodes_number = 250
11
nodes_x_group = 5
12
groups_number = 50
13

  
14
[mobRWP:base]
15
mob_model = RandomWayPoint
16
max_wait_time = 0.0
17

  
18
[mobRPG:base]
19
mob_model = ReferencePointGroup
20
aggregation = 0.5
21

  
22
[mobTLW:base]
23
mob_model = TruncatedLevyWalk
24

  
25
[mobGM:base]
26
mob_model = GaussMarkov
27
alpha = 0.9
28

  
29
[milano]
30
duration = 1000s
31
max_x = 100
32
max_y = 100
33
radius = 30.0
34
mobility_timer = 1s
35
mob_model = Milan
36

  
37

  
38

  
1 39
[baseRWP]
2 40
duration = 1000s
3 41
nodes_number = 250
......
21 59
mobility_timer = 1s
22 60
mob_model = ReferencePointGroup
23 61

  
24
[milano]
25
duration = 1000s
26
nodes_number = 1000
27
max_x = 100
28
max_y = 100
29
radius = 30.0
30
mobility_timer = 1s
31
mob_model = Milan
32

  
33 62

  
34 63
# Impact of Radius
35 64
[ray20:baseRWP]
simulator.py
47 47
        self.expName = sectionExp
48 48
        self.mob = config.configMobility(self.params)
49 49
        self.OP = outPath
50
        NN = self.params['nodes_number']
50
        NN = -1
51
        if 'nodes_number' in self.params:
52
            NN = self.params['nodes_number']
53
        else:
54
            NN = len(next(self.mob))
55
            self.params['nodes_number'] = NN
51 56
        self.statsFiles = {}
52 57
        for i in range(NN):
53 58
            f = open(outPath+"/stats"+'%08d' % i+".csv", 'a+')
util/ConfPars.py
76 76
                retParameters['groups_number'] = int(arg)
77 77
            elif option == 'aggregation':
78 78
                retParameters['aggregation'] = float(arg)
79
            elif option == 'alpha':
80
                retParameters['alpha'] = float(arg)
79 81
            else:
80 82
                print 'Unparsed ', option, '=', settings.get(sectionExp, option)
81 83
        return retParameters
......
83 85
    def configMobility(self, params):
84 86
        userMobi = params['mob_model']
85 87
        supportedModels = ["RandomWayPoint",
86
                           "TimeVariantCommunity", "Milan", "ReferencePointGroup"]
88
                           "TimeVariantCommunity", "Milan", "ReferencePointGroup", "TruncatedLevyWalk", "GaussMarkov"]
87 89
        if userMobi not in supportedModels:
88 90
            print userMobi + " is not supported now!\n" \
89
                "This moility models are currently supported:"
91
                "This mobility models are currently supported:"
90 92
            print ", ".join(supportedModels)
91 93
            sys.exit(1)
92 94
        else:
......
102 104
                    rw = random_waypoint(N, dimensions=(
103 105
                        max_x, max_y), velocity=(min_v, max_v), wt_max=max_wt)
104 106
                    return rw
107
            
105 108
            elif userMobi == "Milan":
106 109
                return milano_mob()
107 110

  
......
120 123

  
121 124
                return rpg
122 125

  
123
            elif userMobi == "TimeVariantCommunity":
124
                '''
125
    Time-variant Community Mobility Model, discussed in the paper
126

  
127
        Wei-jen Hsu, Thrasyvoulos Spyropoulos, Konstantinos Psounis, and Ahmed Helmy, 
128
        "Modeling Time-variant User Mobility in Wireless Mobile Networks," INFOCOM 2007, May 2007.
129

  
130
    This is a variant of the original definition, in the following way:
131
    - Communities don't have a specific area, but a reference point where the 
132
       community members aggregate around.
133
    - The community reference points are not static, but follow a random direction model.
134
    - You can define a list of epoch stages, each value is the duration of the stage.
135
       For each stage a different aggregation value is used (from the aggregation parameter).
136
    - Aggregation values should be doubles between 0 and 1.
137
       For aggregation 0, there's no attraction point and the nodes move in a random walk model.
138
       For aggregation near 1, the nodes move closer to the community reference point.
139

  
140
    Required arguments:
141

  
142
      *nr_nodes*:
143
        list of integers, the number of nodes in each group.
144

  
145
      *dimensions*:
146
        Tuple of Integers, the x and y dimensions of the simulation area.
147

  
148
    keyword arguments:
149

  
150
      *velocity*:
151
        Tuple of Doubles, the minimum and maximum values for community velocities.
126
            elif userMobi == "TruncatedLevyWalk":
127
                N = params['nodes_number']
128
                max_x, max_y = params['max_x'], params['max_y']
129
                tlw = truncated_levy_walk(N, dimensions=(max_x, max_y))
130
                return tlw
152 131

  
153
      *aggregation*:
154
        List of Doubles, parameters (between 0 and 1) used to aggregate the nodes around the community center.
155
        Usually between 0 and 1, the more this value approximates to 1,
156
        the nodes will be more aggregated and closer to the group center.
157
        With aggregation 0, the nodes are randomly distributed in the simulation area.
158
        With aggregation near 1, the nodes are closer to the group center.
132
            elif userMobi == "GaussMarkov":
133
                N = params['nodes_number']
134
                max_x, max_y = params['max_x'], params['max_y']
135
                al = params['alpha']
136
                gm = gauss_markov(N, dimensions=(max_x, max_y), alpha=al)
137
                return gm
159 138

  
160
      *epoch*:
161
        List of Integers, the number of steps each epoch stage lasts.
162
    '''
139
            elif userMobi == "TimeVariantCommunity":
163 140
                if not set(['max_x', 'max_y', 'nodes_x_group', 'min_velocity',
164 141
                            'max_velocity', 'groups_number']).issubset(params.keys()):
165 142
                    print "You miss some params to configure TimeVariantCommunity"
util/milanoMob.py
4 4
    tvc, truncated_levy_walk, random_direction, random_waypoint, random_walk
5 5
import numpy as np
6 6
import numpy
7
import code
7 8

  
8 9

  
9 10
def milano_mob():
......
23 24
        MAX_WT = 0.
24 25

  
25 26
        # Random Waypoint model
26
        rwp = random_waypoint(nr_nodes=200, dimensions=(
27
        rwp = random_waypoint(nr_nodes=100, dimensions=(
27 28
            MAX_X, MAX_Y), velocity=(MIN_V, MAX_V), wt_max=MAX_WT)
28 29

  
29 30
        # Reference Point Group model
30 31
        # In tutto 150 nodi = 10x(5+4+3) + 15x(2)
31 32
        # 10 gruppi X 5
32
        groups = [5 for _ in range(3)]
33
        groups = [5 for _ in range(10)]
33 34
        nr_nodes = sum(groups)
34 35
        rpg5 = reference_point_group(
35 36
            groups, dimensions=(MAX_X, MAX_Y), aggregation=0.5)
36 37

  
37 38
        # 10 gruppi X 4
38
        groups = [4 for _ in range(3)]
39
        groups = [4 for _ in range(10)]
39 40
        nr_nodes = sum(groups)
40 41
        rpg4 = reference_point_group(
41 42
            groups, dimensions=(MAX_X, MAX_Y), aggregation=0.5)
42 43

  
43 44
        # 10 gruppi X 3
44
        groups = [3 for _ in range(3)]
45
        groups = [3 for _ in range(10)]
45 46
        nr_nodes = sum(groups)
46 47
        rpg3 = reference_point_group(
47 48
            groups, dimensions=(MAX_X, MAX_Y), aggregation=0.5)
48 49

  
49 50
        # 15 gruppi X 2
50
        groups = [2 for _ in range(10)]
51
        groups = [2 for _ in range(15)]
51 52
        nr_nodes = sum(groups)
52 53
        rpg2 = reference_point_group(
53 54
            groups, dimensions=(MAX_X, MAX_Y), aggregation=0.5)

Also available in: Unified diff