|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.javaGenes.EOSscheduling.DutyCycleConstraint
Implements constraints of the form: resource must be Available for no more than onTime in any totalTime period. DEFICIENCIES: Does not consider instrument warmup time and allows instument to be turned off for very short periods (e.g., 1 second) to meet constraint.
Field Summary | |
protected static boolean |
debug
|
protected int |
maxOnTime
|
protected int |
onTimeArrayElementDuration
|
protected int[] |
onTimes
|
protected int |
totalTime
|
Constructor Summary | |
DutyCycleConstraint(Horizon horizon,
int inTotalTime,
int inMaxOnTime)
holds data for a constraint where something must be off for at least inOffTime in every period of inTotalTime |
Method Summary | |
protected boolean |
anyUnAvailableNodeTooLong(AvailableNode nodeAtCheckStart,
int maxOnTimeForSearch,
int startTime,
int endTime)
|
protected void |
checkEndNode(AvailableNode endNode,
int startTime,
int endTime)
|
protected void |
checkOnTimes(int[] correct)
|
int |
durationInEndBucket(int endTime)
|
int |
durationInStartBucket(int startTime)
|
boolean |
fastFitCheck(int startTime,
int duration)
used for a quick screening check. |
boolean |
fastFits(AvailabilityTimeline timeline,
AvailableNode node,
int startTime,
int duration)
if a period of 'duration' length starting at startTime became UnAvailable, would the timeline be consistant with the dutycycle constraint? |
boolean |
fits(AvailabilityTimeline timeline)
|
boolean |
fits(AvailabilityTimeline timeline,
AvailableNode node,
int startTime,
int duration)
|
protected int |
getIndex(int time)
|
int |
getOnTimes(int index)
|
void |
initialize()
|
void |
insertAt(int startTime,
int endTime)
|
protected boolean |
okBackward(AvailabilityTimeline timeline,
AvailableNode node,
int endTime,
int maxOnTimeForSearch)
starting at 'endTime', check backward 'totalTime' to see if there is no more than 'maxOnTimeForSearch' UnAvailable time |
protected boolean |
okForward(AvailabilityTimeline timeline,
AvailableNode node,
int startTime,
int maxOnTimeForSearch)
starting at 'startTime', check forward 'totalTime' to see if there is no more than 'maxOnTimeForSearch' UnAvailable time |
void |
setQuickCheckArrays(Horizon horizon)
|
boolean |
slowFits(AvailabilityTimeline timeline,
AvailableNode node,
int startTime,
int duration)
if a period of 'duration' length starting at startTime became UnAvailable, would the timeline be consistant with the dutycycle constraint? Algorithm: - subtract duration to maxOnTime to get the maximum ontime acceptable - check from the beginning of the duration forward - check from the end of the duration backward - for UnAvailable nodes before the duration, check from it's beginning forward - for UnAvailable nodes after the duration, check from it's end backward |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int totalTime
protected int maxOnTime
protected int onTimeArrayElementDuration
protected int[] onTimes
protected static final boolean debug
Constructor Detail |
public DutyCycleConstraint(Horizon horizon, int inTotalTime, int inMaxOnTime)
Method Detail |
public void setQuickCheckArrays(Horizon horizon)
public void initialize()
public boolean fastFitCheck(int startTime, int duration)
public void insertAt(int startTime, int endTime)
protected int getIndex(int time)
public int durationInStartBucket(int startTime)
public int durationInEndBucket(int endTime)
public int getOnTimes(int index)
protected void checkOnTimes(int[] correct)
public boolean fits(AvailabilityTimeline timeline)
public boolean fits(AvailabilityTimeline timeline, AvailableNode node, int startTime, int duration)
public boolean fastFits(AvailabilityTimeline timeline, AvailableNode node, int startTime, int duration)
protected boolean anyUnAvailableNodeTooLong(AvailableNode nodeAtCheckStart, int maxOnTimeForSearch, int startTime, int endTime)
protected void checkEndNode(AvailableNode endNode, int startTime, int endTime)
public boolean slowFits(AvailabilityTimeline timeline, AvailableNode node, int startTime, int duration)
protected boolean okForward(AvailabilityTimeline timeline, AvailableNode node, int startTime, int maxOnTimeForSearch)
protected boolean okBackward(AvailabilityTimeline timeline, AvailableNode node, int endTime, int maxOnTimeForSearch)
|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |