-
Notifications
You must be signed in to change notification settings - Fork 1
Overview of UnitDemandGenerator
The Problem, Purpose, and Objective (PP&O) of UnitDemandGenerator is to address the Problem that realistic demand generation is necessary for increasing realism for logistics-based wargames. As such, the Purpose of UnitDemandGenerator is to provide realistic demand generation for each class of supply depending on unit size and conflict state. The Objective is then to provide quantitative demand data output for logistics-based wargames.
MassCasualty is broken up into 10 distinct parts, present in the code in this order.
- Imports
- File Structure
- Variables
- Data Definition
- Data Storage
- Outputs
- Data Generation
- Running the Program
The imports section at the beginning of the code serves to add any additional packages or libraries that would be needed in calculations or outputs of the program. These imports include:
- OS to interact with the operating system to create the folder structure to store our outputs.
- Math for mathematical operations.
- Random for random number generation.
- Numpy a scientific computing package for math.
- Pandas a data analysis library.
This simply defines in the program where to create output folders to store any generated outputs of the program.
This section includes any variables or parameters needed throughout the system (also referred to as globally). Here we define what unit sizes we are generating demand for as well as the states of conflict. We also define the global constant for the size of the MEF. This is due to the Planner's Manual using the MEF as the default size for their demand calculations. The size of the MEF here is guessed, and can be easily changed.
This defines our unit that demand will be generated for. Each unit has a type (platoon, company, MLR, etc), state (competition, crisis, etc), an inflation factor, and an attrition size. The size of each element is also adjustable. For each state of conflict, there is a corresponding attrition size and inflation factor. In a competition state, there is no attrition and no inflation consideration. In a crisis state, demand increases 1.5x, which can be changed. Attrition in crisis is randomly selected between the values 0.01 and 0.1 which is multiplied by the number of people in the unit to decide the final attrition number. In conflict, demand increases 2x, and attrition decided by random selection of a value between 0.1 and 0.4 and multiplying it by the unit size to calculate final attrition. The current values for inflation and attrition factors were selected as they seemed a decent representation for inflation and attrition in a Pacific-based conflict.
Each class of demand has a base unit, which is the MEF daily demand from the Planner's Reference Manual. This is then divided to get the equivalent request per person, followed by the average request. Average request is based on this request per person, taking into account attrition size and any possible inflation factor. Demand is then randomly selected from a normal distribution of this average and a standard deviation of one. All demand is the absolute value of the random selection as negative demand is not possible in this scenario, and a lognormal distribution was not appropriate for the data. All demand was rounded to the nearest two decimal points.
Supply classes seven and eight have not been included due to lack of data reported in the Planner's Reference Manual.
This section contains the mechanisms for tracking and adding data to a DataFrame for later conversion into CSVs.
This section performs the grouping and outputting of the data into CSV format. All data is outputted, as well as data by class of supply, unit size, and conflict state.
This section has the program generate demand for every unit size and state of conflict previously listed in the global variables.
Lastly, program is ran. Data is outputted to an "outputs" folder, which contains CSV files of all collected and grouped data.
Examples of the data outputs are below.