1.0.12 • Published 1 year ago

precedence-diagram-method v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Demo

Live Demo: https://fireboltcasters.github.io/PrecedenceDiagramMethod/

Installtion

npm install precedence-diagram-method

Usage

import {PrecedenceGraph} from "precedence-diagram-method";


let exampleGraph = {
    "StartLabel": {
        "children": [
            "Marketing",
            "Documentation"
        ],
        "duration": 0
    },
    "Marketing": {
        "children": [
            "Publishing"
        ],
        "duration": 3
    },
    "Documentation": {
        "children": [
            "Publishing"
        ],
        "duration": 4
    },
    "Publishing": {
        "children": [],
        "duration": 2
    }
}

let instance = new PrecedenceGraph(exampleGraph, "StartLabel");
let calcedGraph = instance.getGraph();
let criticalPath = instance.getCriticalPaths();

Each node will have to be in the following format:

<NameOfTheActiticy>: {
    "children": [<Array of children names>],
    "duraion": <DurationOfTheActivity>
}

Each node will have the following fields

Node fields

  • duration: number
  • buffer: number
  • earliestStart: number
  • earliestEnd: number
  • latestStart: number
  • latestEnd: number
  • children: Node
  • parents: Node

Documentation

You can also use additional methods:

instance ()


Get the current precedence graph

instance.getGraph()

Get the start node label of the precedence graph

instance.getStartNode()

Returns is a connection between a child and a parent is critical (no buffer)

instance.isCriticalPath(parentId, childId)

Get the start node label of the precedence graph

instance.getStartNode()

Gets all ciritcal paths

instance. isCriticalPath()

static

Returns true if the loop has a directed loop

PrecedenceGraph.hasLoop(graph)

Resets all calced times on a graph and returns a copy

PrecedenceGraph.resetCalcedTimesGraph(graph)

Calculates the forward precedence graph from a given startLabel and returns a copy

PrecedenceGraph.calcForwardGraph(graph, startLabel)

Returns the highest earliest end on a given graph

PrecedenceGraph.getFromAllEarliestEndsTheLatest(graph)

Sets the highest earliest end to the latest end of all leaf nodes

PrecedenceGraph.setLatestStartToAllLeafes(graph)

Calculates the backward precedence graph

PrecedenceGraph.calcBackwardGraph(graph)

Returns all leaves of a given graph

PrecedenceGraph.getAllLeafes(graph)

There a more functions which I wont describe here further. More information has to be read from the source code.

Contributors

The FireboltCasters

1.0.11

1 year ago

1.0.12

1 year ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.10

2 years ago

0.0.7

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago