DurationSampler
Bases: Sampler
A class to sample durations based on a specified purpose, extending the Sampler class.
Methods:
Name | Description |
---|---|
sample_duration |
Sample a duration for a given purpose, optionally constrained by minimum and maximum duration. |
Source code in tripsender\sampler.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
Sampler
A class to sample from various statistical distributions.
Attributes:
Name | Type | Description |
---|---|---|
json_data |
dict
|
The input JSON data containing distribution parameters. |
gmm_cache |
dict
|
Cache for Gaussian Mixture Model (GMM) objects. |
Methods:
Name | Description |
---|---|
_get_gmm |
Retrieve or create a Gaussian Mixture Model (GMM) with the specified number of components and parameters. |
sample_from_distribution |
Sample from the specified statistical distribution using the provided parameters. |
Source code in tripsender\sampler.py
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
StartTimeSampler
Bases: Sampler
A class to sample start times based on a specified purpose, extending the Sampler class.
Methods:
Name | Description |
---|---|
sample_start_time |
Sample a start time for a given purpose, optionally constrained by minimum and maximum time. |
Source code in tripsender\sampler.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|