001    package edu.nrao.sss.model.project.scheduling.constraint;
002    
003    import edu.nrao.sss.util.EnumerationUtility;
004    
005    /**
006    * An enumeration of operating conditions that may affect the
007    * probability of a scheduling achieving its scientific goals.
008    */
009    
010    public enum ConstraintType {
011            //NOTE: Alma lumps the wind and api together into a single constraint called
012            //weather.  May want to do this.
013            /**
014             * Wind speed.
015             */
016            
017            WIND,
018    
019            /**
020             * Atmospheric Phase Interference.
021             */
022            API,
023            
024            /**
025             * The sine of the current elevation of the target or 0 if the target is
026             * not currently visible.  The idea is to penalize a block if its elevation
027             * is low.
028             */
029            
030            POSITION_ELEVATION,
031            
032            /**
033             * The absolute value of the difference between the current LST and the LST
034             * at the maximum elevation is computed.  The idea is to give a higher probability
035             * of success to an observation if it is close to the maximum elevation of the source.
036             */
037            
038    
039            POSITION_MAXIMUM;
040    
041            
042            private ConstraintType(){
043            }
044            
045    
046    
047            /**
048             * Returns a default constraint type.
049             * @return a default constraint type.
050             */
051            
052            public static ConstraintType getDefault(){
053                    return WIND;
054            }
055    
056            
057            /**
058             * Returns a text representation of this enumeration constant.
059             * @return a text representation of this enumeration constant.
060             */
061            
062            public String toString(){
063                    return EnumerationUtility.getSharedInstance().enumToString(this);
064            }
065    
066            /**
067             * Returns the constraint type represented by {@code text}.
068             * <p>
069             * For details about the transformation, see
070             * {@link EnumerationUtility#enumFromString(Class, String)}.</p>
071             * 
072             * @param text a text representation of a priority type.
073             * 
074             * @return the priority type represented by {@code text}.
075             */
076            
077            public static ConstraintType fromString(String text){
078                    return EnumerationUtility.getSharedInstance()
079                               .enumFromString(ConstraintType.class, text);
080            }
081    }