Class COptQuestSphericalAngleVariable


public class COptQuestSphericalAngleVariable extends COptQuestManifoldVariable
A spherical angle variable. Its value is a direction in three dimensions, given as an elevation and an azimuth in degrees. Use a spherical angle variable when the decision is a pointing direction, such as an antenna boresight or a sensor line of sight.

In every solution that the engine generates, the elevation is from minThetaDeg to maxThetaDeg, and the azimuth is on the arc from minPhiDeg to maxPhiDeg. The azimuth arc has the same rules as the arc of an angle variable: a difference of 360 or more is the full circle, and an arc with minPhiDeg greater than maxPhiDeg crosses 0.

Variable names:

  • <name>@theta: the elevation in degrees, from -90 (straight down) through 0 (the horizon) to 90 (straight up).
  • <name>@phi: the azimuth in degrees, where 0 is north and 90 is east.

The engine reports the azimuth as its equivalent from 0 up to, but not including, 360, not in the range that you declare. For example, for an azimuth declared from -60 to 60, the engine reports -60 as 300. To compare the azimuth with the declared bounds, use the rule for an angle variable, with minPhiDeg and maxPhiDeg. The engine reports the elevation as it is, within the declared range.

In most programs, you add this variable with OptQuestModel.AddSphericalAngleVariable and read its values with OptQuestSolution.GetValue(String) and the generated names. Construct this class only when you add the variable with COptQuestOptimization.AddVariable(COptQuestVariable).

See Also:
  • Constructor Details

    • COptQuestSphericalAngleVariable

      public COptQuestSphericalAngleVariable(String name, double minThetaDeg, double maxThetaDeg, double minPhiDeg, double maxPhiDeg) throws COptQuestException
      Creates a spherical angle variable.
      Parameters:
      name - base name of the variable
      minThetaDeg - smallest elevation, in degrees; must be from -90 to 90
      maxThetaDeg - largest elevation, in degrees; must be from minThetaDeg to 90
      minPhiDeg - start of the azimuth arc, in degrees
      maxPhiDeg - end of the azimuth arc, in degrees
      Throws:
      COptQuestException - if a bound is NaN, if an elevation bound is outside [-90, 90], or if minThetaDeg is greater than maxThetaDeg
  • Method Details

    • getInputVariables

      public List<COptQuestVariable> getInputVariables()
      Returns an empty list, because a spherical angle variable has no ordinary input variables.

      The values of a spherical angle variable are in the list that getProjectedInputVariables() returns. That list has two variables, <name>@theta and <name>@phi.

      Returns:
      an empty list
    • getOutputVariables

      public List<COptQuestUserControlledVariable> getOutputVariables()
      Returns an empty list, because a spherical angle variable has no output variables.

      The values of a spherical angle variable are in the list that getProjectedInputVariables() returns. That list has two variables, <name>@theta and <name>@phi.

      Returns:
      an empty list
    • getProjectedInputVariables

      public List<COptQuestUserControlledVariable> getProjectedInputVariables()
      Description copied from class: COptQuestManifoldVariable
      Returns the decision values of this manifold variable that are not ordinary decision variables.

      For example, an angle variable returns angle@theta, and a mixture variable returns one mix@<component> name for each component. In every solution that the engine generates, and in every suggested solution, these values are inside the set of the variable. Your evaluator reads them as inputs: OptQuestSolution.GetInputNames() returns them.

      A constraint that uses one of these names is checked after the evaluation, like a constraint on an output. Your evaluator can receive values that break the constraint, and the solution is then infeasible.

      Specified by:
      getProjectedInputVariables in class COptQuestManifoldVariable
      Returns:
      fixed-size or immutable list of these variables; never null