Skip to content

Python code to give probabilistic schedule estimates.

Notifications You must be signed in to change notification settings

sgtaylor16/probSched

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

This packages is to facilitate analyzing projects stochastically rather than as a single point. Given a Gannt chart, a scipy.stats distribution can be assigned to a task's duration. The package can then assign tasks duration sampled from their respective random durations.

Input File

A project is created by reading in a .csv file that has the following format:

TaskID Task Duration Predecessors
1 Start 0 []
2 Task 1 10 [1]
3 Task 2 20 [1]
4 Task 3 25 [2-3]
5 Task 4 15 [4]

The TaskID column is a unique integer for a given task. It is not required that the taskID's be ordered in anyway. The Task column is a title or description of the task. The task value does not need to be unique. The Duration column is the duration of the task in a given time unit (usually days). The Predecessors column sets what the predecessor tasks of the task are. The TaskID's of the predecessor task are enclosed in square brackets. If a task has more than one predecessor then enclose all of the predecessor ID's separated by dashes (or spaces). Don't use commas as that messes up the comma parsing when reading in the .csv file.

There are two additional requirements. All tasks must be descendants of a single task of zero duration (Task 1 in the example above). Also, their must be a final task with zero duration that is a descendant of all tasks.

The text file is read in with the following code:

from probSched import base
my_project = base.project("6/1/2020")  #The Datestring in the project argument sets the project start date.
my_project.readTaskTable("MyCSVfile.csv") #Argument is a string path to the .csv file.

Adding Distributions

Reading in the .csv file puts only single point values for the durations of each task. Distributions can be given instead of single point values by assigning scipy.stats object to a task. The scipy.stats object is assigned to the project task with the .add_dist() method as follows:

from scipy.stats import norm #Using a normal distribution from the scipy.stats package
my_distribution = norm(loc = 40, scale = 10) #This line creates a normal distribution with mean=40 and standard deviation=10. See scipy for more information on this object.
my_project.add_dist(2,my_distribution)  #adds the my_distribution object to TaskID 2

The Project Class

The workhorse of the probSched package is the project class. Manipulating the attributes and invoking the methods of the project class are the main ways to ...

summarytable()

About

Python code to give probabilistic schedule estimates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages