This page is under construction and the function cannot be used in the current P2 Engine releases. Will appear soon in the next release of P2 Engine!
Read the project and schedule data (required) as well as the resource, simulation and tracking data (optional) from a file in the PSPLIB format.
The P2 Engine file format contains all relevant data information for project activities, precedence relations, renewable and nonrenewable resources, simulation input settings and tracking information and much more. The following data is always saved in the P2 Engine output file:
The data below is optional and is only saved in the P2 Engine file when relevant and created by the user.
Note 1. Only relevant input data is saved in the P2 Engine file format. Results of calculations are therefore not saved since they can easily be reproduced by reading the P2 Engine file and running a new script. As an example, the results of a simulation run (e.g. criticality index of an activity) are not saved, but can be re-calculated running the simulation again using the simulation input settings stored in the file. There is, however, a grey zone between input data and calculated data. Therefore, some parts are also saved, such as the activity starting times of a schedule, although they might be the results of calculations (using the P2Schedule:earliest_start_schedule_with_float_factor function) rather than input data. However, the user can have shifted activities (using the P2Schedule:change_starttime function) such that they can no longer be considered as calculated data but rather as input data.
Note 2. The optional data (resources, simulation and tracking data) can only be read when the user creates objects prior to calling the P2Reader:read_p2engine_file function. P2Resource:new, P2Simulator:new and P2Tracking:new. When these objects are not created in advance, the reader will return the following return values:
I/O | Type | Name | Description |
---|---|---|---|
input | string | filename | Name of the p2engine file |
input | project | project | a P2Project object |
input | schedule | schedule | a P2Schedule object |
output | integer | success | 0, -1 or -2 (failure) or 1 (success) |