public class IlvCriticalPathCalculator extends Object
IlvCriticalPathCalculator
applies the critical path method to a Gantt
data model. This is done by invoking the computeSchedule()
method. Activities
are rescheduled to start as soon as possible after the project start time, based upon
their preceding and succeeding constraints. The project start time can be
set explicitly or else the earliest start time of all
activities in the data model will be used. Note, that activity reservations are not
taken into account by the critical path computations and resource leveling is not
performed.
After the schedule is recomputed, all activities will have their start and end times
updated to the earliest start and earliest finish times computed by the critical path
method. In addition, all activities that are instances of
IlvGeneralActivity
will have the following
configurable properties set on them:
CPM Attribute | Default Activity Property Name | Property Name Setter |
---|---|---|
Earliest Start Time | "earliestStart" |
setEarliestStartProperty(java.lang.String) |
Earliest Finish Time | "earliestFinish" |
setEarliestFinishProperty(java.lang.String) |
Latest Start Time | "latestStart" |
setLatestStartProperty(java.lang.String) |
Latest Finish Time | "latestFinish" |
setLatestFinishProperty(java.lang.String) |
Total Slack Duration | "totalSlack" |
setTotalSlackProperty(java.lang.String) |
IlvCriticalPathCalculator
does not automatically recompute the critical
path when the data model changes. For this capability, look at the
IlvGanttModelScheduler
class. Also note that IlvCriticalPathCalculator
will disable the autoCalcTimeIntervalFromChildren
property of all activities in the data model. This
is to ensure that this simplistic technique of updating parent activities from their
children will not conflict with the critical path method's updates to the data
model.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CRITICAL_PROPERTY
The default critical boolean property for
activities in the data model.
|
static String |
DEFAULT_EARLIEST_FINISH_PROPERTY
The default earliest finish time property for
activities in the data model.
|
static String |
DEFAULT_EARLIEST_START_PROPERTY
The default earliest start time property for
activities in the data model.
|
static String |
DEFAULT_LATEST_FINISH_PROPERTY
The default latest finish time property for
activities in the data model.
|
static String |
DEFAULT_LATEST_START_PROPERTY
The default latest start time property for
activities in the data model.
|
static String |
DEFAULT_TOTAL_SLACK_PROPERTY
The default total slack duration property for
activities in the data model.
|
Constructor and Description |
---|
IlvCriticalPathCalculator()
Creates a new critical path calculator.
|
IlvCriticalPathCalculator(IlvGanttModel ganttModel)
Creates a new critical path calculator for the specified data model.
|
Modifier and Type | Method and Description |
---|---|
void |
addCriticalPathListener(CriticalPathListener listener)
Adds the specified listener to receive critical path computation events.
|
void |
computeSchedule()
Computes the schedule of the Gantt data model by applying the critical path method.
|
String |
getCriticalProperty()
Returns the name of the critical boolean property for activities in the
data model.
|
IlvDuration |
getCriticalThreshold()
Returns the critical threshold.
|
String |
getEarliestFinishProperty()
Returns the name of the earliest finish time property for activities in the
data model.
|
String |
getEarliestStartProperty()
Returns the name of the earliest start time property for activities in the
data model.
|
IlvGanttModel |
getGanttModel()
Returns the Gantt data model for which this calculator is computing the critical
path.
|
String |
getLatestFinishProperty()
Returns the name of the latest finish time property for activities in the
data model.
|
String |
getLatestStartProperty()
Returns the name of the latest start time property for activities in the
data model.
|
Date |
getProjectStart()
Returns the data model's project start date.
|
String |
getTotalSlackProperty()
Returns the name of the total slack duration property for activities in the
data model.
|
void |
removeCriticalPathListener(CriticalPathListener listener)
Removes the specified listener so that it no longer receives
critical path computation events.
|
void |
setCriticalProperty(String propertyName)
Sets the name of the critical boolean property for activities in the
data model.
|
void |
setCriticalThreshold(IlvDuration threshold)
Sets the critical threshold.
|
void |
setEarliestFinishProperty(String propertyName)
Sets the name of the earliest finish time property for activities in the
data model.
|
void |
setEarliestStartProperty(String propertyName)
Sets the name of the earliest start time property for activities in the
data model.
|
void |
setGanttModel(IlvGanttModel ganttModel)
Sets the Gantt data model for which this calculator will compute the critical
path.
|
void |
setLatestFinishProperty(String propertyName)
Sets the name of the latest finish time property for activities in the
data model.
|
void |
setLatestStartProperty(String propertyName)
Sets the name of the latest start time property for activities in the
data model.
|
void |
setProjectStart(Date projectStart)
Sets the data model's project start date.
|
void |
setTotalSlackProperty(String propertyName)
Sets the name of the total slack duration property for activities in the
data model.
|
public static final String DEFAULT_EARLIEST_START_PROPERTY
"earliestStart"
.public static final String DEFAULT_EARLIEST_FINISH_PROPERTY
"earliestFinish"
.public static final String DEFAULT_LATEST_START_PROPERTY
"latestStart"
.public static final String DEFAULT_LATEST_FINISH_PROPERTY
"latestFinish"
.public static final String DEFAULT_TOTAL_SLACK_PROPERTY
"totalSlack"
.public static final String DEFAULT_CRITICAL_PROPERTY
"critical"
.public IlvCriticalPathCalculator()
setGanttModel(ilog.views.gantt.IlvGanttModel)
method to
associate the data model whose critical path will be computed.public IlvCriticalPathCalculator(IlvGanttModel ganttModel)
ganttModel
- The Gantt data model.public IlvGanttModel getGanttModel()
setGanttModel(ilog.views.gantt.IlvGanttModel)
public void setGanttModel(IlvGanttModel ganttModel)
ganttModel
- The Gantt data model.getGanttModel()
public Date getProjectStart()
setProjectStart(java.util.Date)
public void setProjectStart(Date projectStart)
projectStart
- The project start date of the data model. If null
,
then the earliest start time of all activities in the data model will be used.getProjectStart()
public IlvDuration getCriticalThreshold()
setCriticalThreshold(ilog.views.gantt.IlvDuration)
public void setCriticalThreshold(IlvDuration threshold)
threshold
- The critical duration threshold.getCriticalThreshold()
public String getEarliestStartProperty()
"earliestStart"
.setEarliestStartProperty(java.lang.String)
public void setEarliestStartProperty(String propertyName)
propertyName
- The name of the earliest start time property.getEarliestStartProperty()
public String getEarliestFinishProperty()
"earliestFinish"
.setEarliestFinishProperty(java.lang.String)
public void setEarliestFinishProperty(String propertyName)
propertyName
- The name of the earliest finish time property.getEarliestFinishProperty()
public String getLatestStartProperty()
"latestStart"
.setLatestStartProperty(java.lang.String)
public void setLatestStartProperty(String propertyName)
propertyName
- The name of the latest start time property.getLatestStartProperty()
public String getLatestFinishProperty()
"latestFinish"
.setLatestFinishProperty(java.lang.String)
public void setLatestFinishProperty(String propertyName)
propertyName
- The name of the latest finish time property.getLatestFinishProperty()
public String getTotalSlackProperty()
"totalSlack"
.setTotalSlackProperty(java.lang.String)
public void setTotalSlackProperty(String propertyName)
propertyName
- The name of the total slack duration property.getTotalSlackProperty()
public String getCriticalProperty()
"critical"
.setCriticalProperty(java.lang.String)
public void setCriticalProperty(String propertyName)
propertyName
- The name of the critical boolean property.getCriticalProperty()
public void computeSchedule() throws IlvConstraintCycleException
Note that this will disable the autoCalcTimeIntervalFromChildren
property of all activities in the data model. This
is to ensure that this simplistic technique of updating parent activities from their
children will not conflict with the critical path method's updates to the data
model.
IlvConstraintCycleException
- if a constraint cycle is detected in the
data model.public void addCriticalPathListener(CriticalPathListener listener)
listener
- The listener that will be subscribed to subsequent
CriticalPathListener
events.removeCriticalPathListener(ilog.views.gantt.event.CriticalPathListener)
public void removeCriticalPathListener(CriticalPathListener listener)
listener
- The listener that will be unsubscribed from receiving
CriticalPathListener
events.addCriticalPathListener(ilog.views.gantt.event.CriticalPathListener)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.