Config
Config
Bases: YamlConfig
Source code in passengersim/config/base.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
|
airlines
class-attribute
instance-attribute
A list of airlines.
One convention is to use Airline1, Airline2, ... to list the airlines in the network. Another convention is to use IATA industry-standard two-letter airline codes. See the IATA code search for more information.
booking_curves
class-attribute
instance-attribute
Booking curves
The booking curve points typically line up with the DCPs.
Example
```{yaml} booking_curves: - name: c1 curve: 63: 0.06 56: 0.11 49: 0.15 42: 0.2 35: 0.23 31: 0.25 28: 0.28 24: 0.31 21: 0.35 17: 0.4 14: 0.5 10: 0.62 7: 0.7 5: 0.78 3: 0.95 1: 1.0
choice_models
class-attribute
instance-attribute
Several choice models are programmed behind the scenes.
The choice_models option allows the user to set the parameters used in the utility model for a particular choice model. There are two choice models currently programmed. 1. PODS-like 2. MNL, using the Lurkin et. al. paper (needs more testing and pdating)
Need to explaining more here
classes
class-attribute
instance-attribute
db
class-attribute
instance-attribute
See passengersim.config.DatabaseConfig for detailed documentation.
dcps
class-attribute
instance-attribute
A list of DCPs (data collection points).
The DCPs are given as integers, which represent the number of days before departure. An example of data collection points is given below. Note that typically as you get closer to day of departure (DCP=0) the number of days between two consecutive DCP periods decreases. The DCP intervals are shorter because as you get closer to departure, customer arrival rates tend to increase, and it is advantageous to forecast changes in demand for shorter intervals.
Example
frat5_curves
class-attribute
instance-attribute
FRAT5 curves are used to model sellup rates in Q-forecasting
load_factor_curves
class-attribute
instance-attribute
FRAT5 curves are used to model sellup rates in Q-forecasting
outputs
class-attribute
instance-attribute
See [passengersim.config.OutputConfig][] for detailed documentation.
places
class-attribute
instance-attribute
A list of places (airports, vertiports, other stations).
raw_license_certificate
class-attribute
instance-attribute
rm_systems
class-attribute
instance-attribute
The revenue management systems used by the carriers in this simulation.
See RM Systems for details.
scenario
class-attribute
instance-attribute
Name for this scenario.
The scenario name is helpful when writing different simulations to the same database so you can uniquely identify and query results for a particular scenario.
simulation_controls
class-attribute
instance-attribute
Controls that apply broadly to the overall simulation.
See SimulationSettings for detailed documentation.
__repr__
Source code in passengersim/config/base.py
add_output_prefix
Add a prefix directory to all simulation output files.
Source code in passengersim/config/base.py
model_validate
classmethod
Validate the passengersim Config inputs.
This method reloads the Config class to ensure all imported RmSteps are properly registered before validation.
Parameters:
-
obj
–The object to validate.
-
strict
(bool
) –Whether to raise an exception on invalid fields.
-
from_attributes
–Whether to extract data from object attributes.
-
context
–Additional context to pass to the validator.
Raises:
-
ValidationError
–If the object could not be validated.
Returns:
-
Config
–The validated model instance.
Source code in passengersim/config/base.py
YamlConfig
Bases: PrettyModel
Source code in passengersim/config/base.py
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 92 93 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 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
from_yaml
classmethod
Read from YAML to an unvalidated addicty.Dict.
Parameters:
-
filenames
(path - like or list[path - like]
) –If multiple filenames are provided, they are loaded in order and values with matching keys defined in later files will overwrite the ones found in earlier files.
Returns:
-
Config
–
Source code in passengersim/config/base.py
to_yaml
to_yaml(
stream: os.PathLike | io.FileIO | None = None,
*,
include: IncEx = None,
exclude: IncEx = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
warnings: bool = True
) -> None | bytes
Write a config to YAML format.
Parameters:
-
stream
(Path - like or File - like
, default:None
) –Write the results here. If given as a path, a new file is written at this location, or give a File-like object open for writing.
-
include
(list[int | str]
, default:None
) –A list of fields to include in the output.
-
exclude
(list[int | str]
, default:None
) –A list of fields to exclude from the output.
-
exclude_unset
(bool
, default:False
) –Whether to exclude fields that are unset or None from the output.
-
exclude_defaults
(bool
, default:False
) –Whether to exclude fields that are set to their default value from the output.
-
exclude_none
(bool
, default:False
) –Whether to exclude fields that have a value of
None
from the output. -
warnings
(bool
, default:True
) –Whether to log warnings when invalid fields are encountered.
Returns:
-
bytes or None
–When no stream is given, the YAML content is returned as bytes, otherwise this method returns nothing.