|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.liu.ida.critiquer.activities.AbstractParamChangedListener
se.liu.ida.critiquer.constraints.StandardConstraint
se.liu.ida.critiquer.constraints.ResourceUsageCritic
public class ResourceUsageCritic
A critic that is supposed to display information on resource usage depending on which resources are used at the current time in the time view
For each activity that is created, a constraint map is maintained that holds eq constraints for the activity start and end times so that their values reflect those of the mission time. The map also contains IfOnlyIf constraints that forces an integer variable agentUsage to 1 if the current time in the time view is within the mission time and 0 otherwise.
There is finally a total sum of the resource usage which is the sum of all agentUsage variables for all activities.
Field Summary | |
---|---|
static int |
MAX_USAGE
|
Fields inherited from class se.liu.ida.critiquer.constraints.StandardConstraint |
---|
applicableViews, statusListeners, violationActivities |
Constructor Summary | |
---|---|
ResourceUsageCritic()
|
Method Summary | ||
---|---|---|
JComponent |
getComponent()
Return the chart panel |
|
String |
getDescription()
|
|
protected void |
initApplicableViews()
This view is only applicable to the time view |
|
|
paramChanged(Activity activity,
Parameter<T> p)
A parameter has changed value |
|
void |
viewUpdated(View v,
Graphics2D g2)
We only need set the currentTime through changing the currentTime eq constraint since the updating is already done by the
ChartPanel component |
Methods inherited from class se.liu.ida.critiquer.constraints.StandardConstraint |
---|
addStatusListener, debug, error, getApplicableViews, getColor, info, isActive, isApplicableFor, isConsistent, removeStatusListener, setActive, setColor, setConsistent, warn |
Methods inherited from class se.liu.ida.critiquer.activities.AbstractParamChangedListener |
---|
activityCreated, activityRemoved, activityUpdated, compareTo, paramAdded |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_USAGE
Constructor Detail |
---|
ResourceUsageCritic()
Method Detail |
---|
protected void initApplicableViews()
initApplicableViews
in class StandardConstraint
public String getDescription()
getDescription
in interface SingletonConstraint
public void viewUpdated(View v, Graphics2D g2)
eq
constraint since the updating is already done by the
ChartPanel component
viewUpdated
in interface ViewRenderingListener
public <T> void paramChanged(Activity activity, Parameter<T> p)
ActivityUpdateListener
paramChanged
in interface ActivityUpdateListener
paramChanged
in class AbstractParamChangedListener
public JComponent getComponent()
getComponent
in interface GUIComponentCritic
GUIComponentCritic.getComponent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |