Skip to main content

A python package dedicated to project scheduling

Project description

cheche_pm - Project Scheduling Toolkit

A Python package for project scheduling, designed to simplify project management tasks.

Table of Contents

Installation

To install cheche_pm, you can use pip:

pip install cheche_pm

Usage

To use cheche_pm, import the Project class and start utilizing its methods. Here are some of the key methods provided by the package:

Create project

creates an empty project. Activities can be added manually.

from cheche_pm import Project

p = p.Project()

p.add_activity(activity_name='A',activity_duration=2,activity_precedence = [None], activity_resources= [2,4,5])
p.add_activity(activity_name='B',activity_duration=3,activity_precedence =['A'],activity_resources= [3,7,8])
p.add_activity(activity_name='C',activity_duration=4,activity_precedence =['B'],activity_resources=[3,2,2])
p.add_activity(activity_name='D',activity_duration=3,activity_precedence =['A'],activity_resources=[4,5,6])

Activities can be also deleted.

p.delete_activity('D')

Once the activities are created the user, can add the terminal dummy nodes. "Start" and "End" by using the following methods.

p.add_dummies_create_project_network()

from_csv or from_excel

A project can be created from a .csv file or .xlsx file. Imagine that we have an MS EXCEL file with the data below

Activity Description Duration Precedence Cost Bulbasaur Charizard Squirtle
A F.House 5 1000 1 0 0
B F.Pool 2 2000 1 0 0
C Walls 5 A 3500 0 1 0
D Pool 6 B 4500 0 0 1
E Roof 5 C 2600 0 1 0
F Windows 2 C 7000 0 1 0
G Electricity 3 C 8000 0 0 1
H S.Panels 2 E 1000 0 0 1
I Plumbing 4 F 5600 0 0 1
J Finishings 3 H, I 12000 0 0 1

A project can be created using the following methods:

.csv file

p = Project.from_csv(filename='data_project.csv',rcpsp_format=True,n_resources= 3,max_resources=[1,1,1])

.xlsx file

p = Project.from_excel(filename='data_project.xlsx',rcpsp_format=True,n_resources= 3,max_resources=[1,1,1])

CPM

This method allows the generation of project schedule using the critical path method

p.CPM()

the user can ask for the critical path

p.get_critical_path()

priority_list

This method allows the user to generate a priority list from a given priority rule:

  • LPT: Longest processing time
  • SPT: Shortest processing time
  • LIS: Least immediate successors
  • MIS: Most immediate successor
  • LTS: Least total successors
  • MTS: Most total successors
  • sEST: Smallest Earliest Start Time
  • gEST: Greatest Earliest Start Time
  • sEFT: Smallest Earliest Finish Time
  • gEFT: Greatest Earliest Finish Time
  • sLST: Smallest Latest Start Time
  • gLST: Greatest Latest Start Time
  • sLFT: Smallest Latest Finish Time
  • gLFT: Greatest Latest Finish Time
  • MINF: Minimum float
  • MAXF: Maximum float
  • GRPW: Greatest GRPW
  • LRPW: Lowest GRPW
  • FCFS: First comes first served
  • LCFS: Last comes first served
  • GRD: Greatest resource demand
  • LRD: Lowest resource demand
  • GCRD: Greatest cumulative resource demand
  • LCRD: Lowest cumulative resource demand

The user can ask for an individual priority list.

PL = p.get_priority_list(priority_rule= 'FCFS',verbose=True,save=True)

Scheduling_methods

Once the user has a priority list it can decide to produce an schedule from it. The user can generate a serial schedule (SSG) or a parallel one (PSG)

Serial (SSG)

ssg = p.SSG(PL,max_resources=[1,1,1],verbose=False)

Parallel (PSG)

psg = p.PSG(PL,max_resources=[1,1,1],verbose=False)

The user can also decide to run all priority list heuristics, and schedule each one via the two methods. This method will return the best schedule obtained.

p.run_all_pl_heuristics()

Visualizations of schedules

Once an schedule is produced, the user can ask for a datetime schedule by providing the date for the project start.

w_sche = p.generate_datetime_schedule(solution = ssg,start_date="2023-09-03",weekends_work=False,max_resources=[1,1,1],verbose=True)

The user can then ask for a gantt chart of this datetime schedule

p.plot_date_gantt(w_sche)

The user can ask for the critical chain of this schedule

p.get_critical_chain(ssg,max_resources=[1,1,1])

The user can perform resource vistualizations

p.plot_resource_levels(ssg)
p.RCPSP_plot(ssg,resource_id=0)

Genetic_Algorithm

The user can use the genetic algorithm optimization method to find the optimal schedule.

p.genetic_algorithm_optimization(popSize = 40, elite_percentage = 0.2, crossover_rate = 0.5, mutationRate = 0.5, generations = 100,show = True)

Risk analysis

These methods offers a collection of monte carlo simulation methods, that can be used to evaluate project makespan uncertainty as well as the effectivenes of activity buffers.

Simple Monte Carlo simulation

p.monte_carlo_cpm_simple(optimistic=0.25,pessimistic=1)

Detailed Monte Carlo simulation

pessimistic = {'A':7.5,'B':3.5,'C':7.5,'D':9,'E':7.5,'F':3,'G':4.5,'H':3,'I':6,'J':4.5}
optimistic = {'A':2.5,'B':1,'C':2.5,'D':3,'E':2.5,'F':1,'G':1.5,'H':1,'I':2,'J':1.5}

p.monte_carlo_cpm_detailed(optimistic=optimistic,pessimistic=pessimistic, NumberIterations=1000)

Buffer analysis

pessimistic = {'A':7.5,'B':3.5,'C':7.5,'D':9,'E':7.5,'F':3,'G':4.5,'H':3,'I':6,'J':4.5}
optimistic = {'A':2.5,'B':1,'C':2.5,'D':3,'E':2.5,'F':1,'G':1.5,'H':1,'I':2,'J':1.5}
buffer = {'A':2,'C':2,'E':3,'H':2,'F':2,'I':1,'J':2}

p.monte_carlo_detail_buffer_analysis(optimistic=optimistic,pessimistic=pessimistic,buffer=buffer, NumberIterations=2000)

Contributors

Author: Luis Fernando Perez Armas

Email: luisfernandopa1212@gmail.com

LinkedIn: LinkedIn Profile

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2023, Luis Fernando Pérez Armas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

=======

History

=======

0.1.0 (2023-09-03)

  • First release on PyPI.

+++++++++++++++++++

0.1.4 (2023-09-04)

+++++++++++++++++++

0.1.5 (2023-09-04)

+++++++++++++++++++

0.1.6 (2023-09-29)

+++++++++++++++++++

0.1.7 (2023-09-29)

Bugfixes

  • Error with MTS,LTS, MIS and LIS priority rules fixed.
  • Bug related to incorrect choosing of activities under the condition of a priority rule tie, was fixed.

+++++++++++++++++++

0.1.8 (2023-10-03)

  • Weak forbidden set function added
  • Minimum forbidden set function added
  • Simple monte carlo buffer analysis added
  • Possibility to create a project from a .rcp file and from instances of the CV dataset

+++++++++++++++++++

0.1.9 (2023-10-03)

  • Extra information added to the monte carlo buffer analysis methods
  • Critical Path Method returns a dataframe with the basic outputs ES,EF,LS,LF,F

+++++++++++++++++++

0.1.10 (2023-10-03)

  • Bug fix with the monte carlo buffer analysis methods

+++++++++++++++++++

0.1.11 (2023-10-03)

+++++++++++++++++++

0.1.12 (2023-10-08)

  • Feasible subset function added
  • Function that calculate naive bounds for each activity, based on a time horizon

+++++++++++++++++++

0.1.13 (2023-10-08)

  • Bug fix with the outputs of forbidden sets and feasible set.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cheche_pm-0.1.13.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cheche_pm-0.1.13-py2.py3-none-any.whl (39.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file cheche_pm-0.1.13.tar.gz.

File metadata

  • Download URL: cheche_pm-0.1.13.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for cheche_pm-0.1.13.tar.gz
Algorithm Hash digest
SHA256 bc13b94ddf810fe15b6e3c5be0debf7e27bf6b3e965d6785e9ed26a6af384bb6
MD5 6cdc56714498ab8f3db510e04b60220b
BLAKE2b-256 9176c776094b36d81f5f3e91c13971116516d231b82209ea6c8dc1faa4020058

See more details on using hashes here.

File details

Details for the file cheche_pm-0.1.13-py2.py3-none-any.whl.

File metadata

  • Download URL: cheche_pm-0.1.13-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for cheche_pm-0.1.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 842d5d7b99f337d0e6d0ada924b9ab5983c228ea7ff0e63338af6102cf45be82
MD5 f637b2852926e437e72b7111f8beb10d
BLAKE2b-256 3e8d99b28d8b5ef5a97ae348819b327c85af3bbc9fed12a4cb7f8524b7883d50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page