edu.isi.pegasus.planner.provisioner

## Class OccupationDiagram

- java.lang.Object
- - edu.isi.pegasus.planner.provisioner.OccupationDiagram

    public class OccupationDiagram
    extends java.lang.Object

This class keeps structure of an Occupation Diagram and conduct BTS algorithm

Author:
  Eunkyu Byun

### Nested Class Summary

Nested Classes
`private class` `OccupationDiagram.NodeComp` Comparator which compare the schedulable duration of two nodes

### Field Summary

Fields
`(package private) int` `max`
`(package private) int` `maxIndex`
`(package private) java.util.TreeSet` `nodes`
`(package private) long` `RFT`
`(package private) java.util.LinkedList[]` `timeMap`

### Constructor Summary

Constructors
Constructor and Description
`OccupationDiagram(long rft)` Constructor

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `add(Node node)` Add tasks into the occupation diagram.
`int` `balance(int goal, boolean print)` Run Task redistribution phase of BTS algorithm
`private void` `printNodes()`
`int` `stack(boolean print)` Run Task placement phase of BTS algorithm

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### nodes

    java.util.TreeSet nodes

#### RFT

    long RFT

#### timeMap

    java.util.LinkedList[] timeMap

#### max

    int max

#### maxIndex

    int maxIndex

### Constructor Detail

#### OccupationDiagram

    public OccupationDiagram(long rft)

Constructor

Parameters:
  `rft` - Requested finish time(deadline) of algorithm.

### Method Detail

#### add

    public void add(Node node)

Add tasks into the occupation diagram. But task placement is not conducted yet

Parameters:
  `node` - Node to be added

#### printNodes

    private void printNodes()

#### stack

    public int stack(boolean print)

Run Task placement phase of BTS algorithm

Parameters:
  `print` - if true print debug message to stdout
Returns:
  maxinum height of Occupation diagram when Task placement is done

#### balance

    public int balance(int goal,
                       boolean print)

Run Task redistribution phase of BTS algorithm

Parameters:
  `goal` - Redistribution loop is stop if maximum height of OD reach this goal value.
  `print` - if true print debug message to stdout
Returns:
  maxinum height of Occupation diagram when Task redistribution is done