-
Notifications
You must be signed in to change notification settings - Fork 1
/
args.py
58 lines (56 loc) · 5.26 KB
/
args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import argparse
TIME_HORIZON = 5_000
CATALOG_SIZE = 20
QUERY_NODES = '1'
CUSTOM_WEIGHTS = ''
argparser = argparse.ArgumentParser(description='Online Multi-agent Cache Network')
argparser.add_argument('--max_capacity', default=5, type=int, help='Maximum capacity per cache')
argparser.add_argument('--min_capacity', default=5, type=int, help='Minimum capacity per cache')
argparser.add_argument('--max_weight', default=5, type=float, help='Maximum edge weight')
argparser.add_argument('--min_weight', default=1, type=float, help='Minimum edge weight')
argparser.add_argument('--time_horizon', default=TIME_HORIZON, type=int, help='Time horizon')
argparser.add_argument('--catalog_size', default=CATALOG_SIZE, type=int, help='Catalog size')
argparser.add_argument('--query_nodes', default=QUERY_NODES, type=str, help='Nodes generating queries')
argparser.add_argument('--graph_size', default=3, type=int, help='Network size')
argparser.add_argument('--graph_degree', default=3, type=int,
help='Degree. Used by balanced_tree, regular, barabasi_albert, watts_strogatz')
argparser.add_argument('--graph_p', default=0.10, type=int, help='Probability, used in erdos_renyi, watts_strogatz')
argparser.add_argument('--random_seed', default=42, type=int, help='Random seed')
argparser.add_argument('--players', default=2, type=int, help='Number of agents')
argparser.add_argument('--debug_level', default='INFO', type=str, help='Debug Level',
choices=['INFO', 'DEBUG', 'WARNING', 'ERROR'])
argparser.add_argument('--cache_type', default='fair', type=str, help='Policy type: fair is online horizon fair (OHF) policy, fairslotted is online slot fair '
'(OSF) policy',
choices=['fair', 'fairslotted', 'lru', 'lfu'])
argparser.add_argument('--traces',
default=f'./traces/trace_catalog_20_T_5000_B_100_100_s_1.2_roll_0.pk',
type=str,
help="Traces' paths (generated by tracegenerator.py)")
argparser.add_argument('--construct_pareto_front', action='store_true', help='Construct the Pareto front')
argparser.add_argument('--n_pareto_front', default=10, type=int, help='Number of samples to construct Pareto front')
argparser.add_argument('--construct_utility_point_cloud', action='store_true', help='construct feasibility set (point cloud)')
argparser.add_argument('--n_utility_point_cloud', default=1_000, type=int, help='Number of random samples to construct feasibility set')
argparser.add_argument('--cached_offline_results', action='store_true', help='Reuse offline results (Pareto front, feasibility set, static OPT, etc.)')
argparser.add_argument('--output', default='res/topology/', type=str, help='Output path')
argparser.add_argument('--alpha', default=1.0, type=float, help='Inequality aversion parameter (alpha-fairness parameter)')
argparser.add_argument('--custom_weights', default=CUSTOM_WEIGHTS, type=str, help='Customize the retrieval costs (weights)')
argparser.add_argument('--scale_repo_weight', default=1., type=float, help='The retrieval cost to any repository node is scaled by this factor')
argparser.add_argument('--fairslotted_freeze_period', default=1, type=int, help='Freezing period for fairslotted policy')
argparser.add_argument('--telescope_requests', action='store_true', help='Traces are loaded at each query node. When this parameter is enabled, '
'only a single request batch is generated at a randomly selected node.')
argparser.add_argument('--external_disagreement_points', default='', type=str, help='Input disagreement points (Nash bargaining scenario) alpha = 1')
argparser.add_argument('--umin_umax', default='0.01-1', type=str, help='Input minimum and maximum value of benchmark utility')
argparser.add_argument('--resources_bias', default=0, type=float, help='Zipf distribution exponent. The number of nodes associated to each agent are '
'generated according to this distribtution. When set to 0, the number of nodes '
'associated to each agent is uniform on average.')
argparser.add_argument('--repo_nodes', default=1, type=int, help='Number of Repository nodes permanently storing the catalog.')
argparser.add_argument('--graph_type', default="cycle", type=str, help='Graph type',
choices=['erdos_renyi', 'balanced_tree', 'hypercube', "cicular_ladder", "cycle",
"grid_2d", 'lollipop', 'expander', 'star', 'barabasi_albert',
'watts_strogatz',
'regular', 'powerlaw_tree', 'small_world', 'geant', 'abilene', 'dtelekom',
'servicenetwork', 'line'])
argparser.add_argument('--experiment_name', default='exp', type=str, help='Experiment Name')
argparser.add_argument('--experiment_subname', default='', type=str, help='Sub-experiment Name')
argparser.add_argument('--record_offline_stats_only', action='store_true', help='Record offline statistics only (Pareto front, feasibility set, static OPT, '
'etc.)')