public class IlvGanttModelScheduler extends Object
IlvGanttModelScheduler
applies the critical path method
to a Gantt data model. This can be done manually by invoking the
schedule()
method or by establishing a
scheduling session.
The critical path method can also be automatically re-applied when
the Gantt data model changes by calling
setAutoScheduling(true)
. The actual
computations are performed by an internal instance of the
IlvCriticalPathCalculator
class.
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) |
IlvGanttModelScheduler
Note, that the critical path computation 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 | Class and Description |
---|---|
static interface |
IlvGanttModelScheduler.ErrorHandler
This interface is used to pass back exceptions that occur during
computation of a data model's critical path.
|
static class |
IlvGanttModelScheduler.LoggingErrorHandler
This class is the default
IlvGanttModelScheduler.ErrorHandler implementation that
logs all exceptions as warnings. |
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 |
---|
IlvGanttModelScheduler()
Creates a new critical path scheduler.
|
IlvGanttModelScheduler(IlvGanttModel ganttModel)
Creates a new critical path scheduler 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 |
beginSchedulingSession()
Starts a scheduling session that must be terminated by calling
endSchedulingSession() . |
void |
endSchedulingSession()
Ends a scheduling session that was begun by calling
beginSchedulingSession() . |
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.
|
IlvGanttModelScheduler.ErrorHandler |
getErrorHandler()
Returns the error handler that is used during scheduling computations.
|
IlvGanttModel |
getGanttModel()
Returns the Gantt data model for which this scheduler 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.
|
boolean |
isAutoScheduling()
Returns whether the schedule is automatically recomputed when the
Gantt data model changes.
|
boolean |
isScheduling()
Returns whether a schedule is currently being computed.
|
void |
removeCriticalPathListener(CriticalPathListener listener)
Removes the specified listener so that it no longer receives critical
path computation events.
|
void |
schedule()
Computes the schedule of the Gantt data model.
|
void |
setAutoScheduling(boolean autoSchedule)
Sets whether the schedule is automatically recomputed when the Gantt
data model changes.
|
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 |
setErrorHandler(IlvGanttModelScheduler.ErrorHandler handler)
Sets the error handler that is used during scheduling computations.
|
void |
setGanttModel(IlvGanttModel ganttModel)
Sets the Gantt data model for which this scheduler 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 IlvGanttModelScheduler()
setGanttModel(ilog.views.gantt.IlvGanttModel)
method to associate the data model whose critical path will be
automatically computed.public IlvGanttModelScheduler(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 boolean isScheduling()
public void beginSchedulingSession()
endSchedulingSession()
. Scheduling sessions can be nested
and scheduling computation is deferred until the outermost enclosing
session is ended. Any errors encountered during computation of the
schedule will be reported to the current
error handler.public void endSchedulingSession()
beginSchedulingSession()
. The schedule is recomputed when the
outermost session is ended. Any errors encountered during
computation of the schedule will be reported to the current
error handler.public void schedule()
public boolean isAutoScheduling()
false
.public void setAutoScheduling(boolean autoSchedule)
autoSchedule
- Indicates whether to enable or disable automatic
rescheduling.public IlvGanttModelScheduler.ErrorHandler getErrorHandler()
IlvGanttModelScheduler.LoggingErrorHandler
which logs
all exceptions as warnings.public void setErrorHandler(IlvGanttModelScheduler.ErrorHandler handler)
handler
- The error handler.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 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.