SampleTrip
TripGeneration类初始化
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Net
|
路网对象 |
None
|
time_step
|
float
|
仿真步长(s) |
0.1
|
speed_miu
|
float
|
仿真速度均值(m/s) |
12.0
|
speed_sigma
|
float
|
仿真速度标准差(m/s) |
3.6
|
save_gap
|
int
|
每多少仿真步保存一次真实轨迹数据,整数 |
1
|
loc_frequency
|
float
|
每多少s进行一次GPS定位,该值必须大于仿真步长 |
2.0
|
loc_error_sigma
|
float
|
定位误差标准差(m) |
40.0
|
loc_error_miu
|
float
|
定位误差均值(m) |
0.0
|
Source code in src/gotrackit/generation/SampleTrip.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
TripGeneration的类方法:generate_rand_trips函数 - 生成随机路径的trip
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trip_num
|
int
|
|
10
|
instant_output
|
bool
|
是否即时输出,即是否每计算完一次行程就存储GPS数据文件、逐帧轨迹文件 |
False
|
out_fldr
|
str
|
存储输出文件的目录 |
'./'
|
time_format
|
str
|
输出GPS数据的时间列的格式 |
'%Y-%m-%d %H:%M:%S'
|
agent_flag
|
str
|
标志字符 |
'agent'
|
start_year
|
int
|
车辆出发的起始年 |
2022
|
start_month
|
int
|
车辆出发的起始月 |
5
|
start_day
|
int
|
车辆出发的起始日 |
15
|
start_hour
|
int
|
车辆出发的起始小时 |
10
|
start_minute
|
int
|
车辆出发的起始分钟 |
20
|
start_second
|
int
|
车辆出发的起始秒 |
12
|
file_type
|
str
|
输出文件的类型,shp或者geojson |
'geojson'
|
Returns:
| Type | Description |
|---|---|
|
真实轨迹数据表、GPS轨迹数据表、混合数据表 |
Source code in src/gotrackit/generation/SampleTrip.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
TripGeneration的类方法:generate_od_trips函数 - 生成指定OD路径的trip
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
od_set
|
list or tuple
|
起始节点OD对,按照起始节点进行路径搜索后生成trip,形如[(o_node, d_node), …] 例如[(12, 23), (34, 111)],表示生成2个trip,分别为节点12到节点23的最短路径、节点34到节点111的最短路径 |
None
|
instant_output
|
bool
|
是否即时输出,即是否每计算完一次行程就存储GPS数据文件、逐帧轨迹文件 |
False
|
out_fldr
|
str
|
存储输出文件的目录 |
'./'
|
time_format
|
str
|
输出GPS数据的时间列的格式 |
'%Y-%m-%d %H:%M:%S'
|
agent_flag
|
str
|
标志字符 |
'agent'
|
start_year
|
int
|
车辆出发的起始年 |
2022
|
start_month
|
int
|
车辆出发的起始月 |
5
|
start_day
|
int
|
车辆出发的起始日 |
15
|
start_hour
|
int
|
车辆出发的起始小时 |
10
|
start_minute
|
int
|
车辆出发的起始分钟 |
20
|
start_second
|
int
|
车辆出发的起始秒 |
12
|
file_type
|
str
|
输出文件的类型,shp或者geojson |
'geojson'
|
Returns:
| Type | Description |
|---|---|
|
真实轨迹数据表、GPS轨迹数据表、混合数据表 |
Source code in src/gotrackit/generation/SampleTrip.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
TripGeneration的类方法:generate_destined_trips函数 - 生成指定路径的trip
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_paths
|
list or tuple
|
路径节点序列,形如[[node1, node2, node3, …], [node5, node7, node9, …],…] 例如[(12, 90, 9012, 123), (3412, 23, 112, 23), (34, 344, 111)],表示生成3个trip,每个trip的节点序列已经指定好 |
None
|
instant_output
|
bool
|
是否即时输出,即是否每计算完一次行程就存储GPS数据文件、逐帧轨迹文件 |
False
|
out_fldr
|
str
|
存储输出文件的目录 |
'./'
|
time_format
|
str
|
输出GPS数据的时间列的格式 |
'%Y-%m-%d %H:%M:%S'
|
agent_flag
|
str
|
标志字符 |
'agent'
|
start_year
|
int
|
车辆出发的起始年 |
2022
|
start_month
|
int
|
车辆出发的起始月 |
5
|
start_day
|
int
|
车辆出发的起始日 |
15
|
start_hour
|
int
|
车辆出发的起始小时 |
10
|
start_minute
|
int
|
车辆出发的起始分钟 |
20
|
start_second
|
int
|
车辆出发的起始秒 |
12
|
file_type
|
str
|
输出文件的类型,shp或者geojson |
'geojson'
|
Returns:
| Type | Description |
|---|---|
|
真实轨迹数据表、GPS轨迹数据表、混合数据表 |
Source code in src/gotrackit/generation/SampleTrip.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |