AGI STK Objects 11 Send comments on this topic.
IAgFigureOfMerit Interface





Description

Figure of Merit properties.

Object Model








Public Methods

Public Method IsDefinitionTypeSupported Gets a value indicating whether the specified type can be used.
Public Method SetAccessConstraintDefinition Set the access constraint definition.
Public Method SetAccessConstraintDefinitionName Set the access constraint definition by name.
Public Method SetDefinitionType Set the definition type.
Public Method SetScalarCalculationDefinition Set the scalar calculation definition.

Public Properties

Public Property Definition Definition properties of the FOM.
Public Property DefinitionSupportedTypes Returns an array of valid choices.
Public Property DefinitionType Definition type for the FOM.
Public Property Graphics 2D graphics properties of the FOM.
Public Property GridInspector The Grid inspector tool.
Public Property VO 3D graphics properties of the FOM.

Example

Create a figure of merit on a coverage definition
[C#] Copy Code
// Get the coverage definition as a IAgStkObject interface 
IAgStkObject covdefObject = covdef as IAgStkObject; 
 
// Create the figure of merit 
IAgFigureOfMerit fom = covdefObject.Children.New(AgESTKObjectType.eFigureOfMerit, "MyFigureOfMerit"as IAgFigureOfMerit; 
 

Configure access duration figure of merit
[C#] Copy Code
// Set figure of merit defintion to eFmAccessDuration 
fom.SetDefinitionType(AgEFmDefinitionType.eFmAccessDuration); 
 
// Get IAgFmDefCompute interface 
IAgFmDefCompute defComp = fom.Definition as IAgFmDefCompute; 
 
if (defComp.IsComputeTypeSupported(AgEFmCompute.ePercentAbove)) 

    // Set Compute type to supported compute option 
    defComp.SetComputeType(AgEFmCompute.ePercentAbove); 
 
    // Get compute option compute interface 
    IAgFmDefDataPercentLevel fomData = defComp.Compute as IAgFmDefDataPercentLevel; 
    fomData.PercentLevel = .25

 

Configure coverage time figure of merit
[C#] Copy Code
// Set figure of merit defintion to eFmCoverageTime 
fom.SetDefinitionType(AgEFmDefinitionType.eFmCoverageTime); 
 
// Get IAgFmDefCompute interface 
IAgFmDefCompute defComp = fom.Definition as IAgFmDefCompute; 
 
if (defComp.IsComputeTypeSupported(AgEFmCompute.eTotalTimeAbove)) 

    // Set Compute type to supported compute option 
    defComp.SetComputeType(AgEFmCompute.eTotalTimeAbove); 
 
    // Get compute option compute interface 
    IAgFmDefDataMinAssets fomData = defComp.Compute as IAgFmDefDataMinAssets; 
    fomData.MinAssets = 15

 

Set the figure of merit definition to access constraint by name
[C#] Copy Code
IAgFmDefAccessConstraint defAccessCnstr = fom.SetAccessConstraintDefinitionName("AzimuthRate"); 
 
// Confiure access constraint properties 
defAccessCnstr.SetComputeType(AgEFmCompute.eMaximum); 
defAccessCnstr.AcrossAssets = AgEFmAcrossAssets.eFmMinimum; 
defAccessCnstr.TimeStep = 60.0
 

Configure figure of merit definition altitude access constraint
[C#] Copy Code
// Set access constraint defintion to altitude 
fom.SetAccessConstraintDefinition(AgEFmConstraintName.eFmAltitude); 
 
// Get IAgFmDefAccessConstraint interface 
IAgFmDefAccessConstraint defAccessCnstr = fom.Definition as IAgFmDefAccessConstraint; 
 
// Confiure access constraint properties 
defAccessCnstr.SetComputeType(AgEFmCompute.eMaximum); 
defAccessCnstr.AcrossAssets = AgEFmAcrossAssets.eFmMinimum; 
defAccessCnstr.TimeStep = 60.0
 

Create a figure of merit on a coverage definition
[Visual Basic .NET] Copy Code
' Get the coverage definition as a IAgStkObject interface
Dim covdefObject As IAgStkObject = TryCast(covdef, IAgStkObject)

' Create the figure of merit
Dim fom As IAgFigureOfMerit = TryCast(covdefObject.Children.[New](AgESTKObjectType.eFigureOfMerit, "MyFigureOfMerit"), IAgFigureOfMerit)

Configure access duration figure of merit
[Visual Basic .NET] Copy Code
' Set figure of merit defintion to eFmAccessDuration
fom.SetDefinitionType(AgEFmDefinitionType.eFmAccessDuration)

' Get IAgFmDefCompute interface
Dim defComp As IAgFmDefCompute = TryCast(fom.Definition, IAgFmDefCompute)

If defComp.IsComputeTypeSupported(AgEFmCompute.ePercentAbove) Then
    ' Set Compute type to supported compute option
    defComp.SetComputeType(AgEFmCompute.ePercentAbove)

    ' Get compute option compute interface
    Dim fomData As IAgFmDefDataPercentLevel = TryCast(defComp.Compute, IAgFmDefDataPercentLevel)
    fomData.PercentLevel = 0.25
End If

Configure coverage time figure of merit
[Visual Basic .NET] Copy Code
' Set figure of merit defintion to eFmCoverageTime
fom.SetDefinitionType(AgEFmDefinitionType.eFmCoverageTime)

' Get IAgFmDefCompute interface
Dim defComp As IAgFmDefCompute = TryCast(fom.Definition, IAgFmDefCompute)

If defComp.IsComputeTypeSupported(AgEFmCompute.eTotalTimeAbove) Then
    ' Set Compute type to supported compute option
    defComp.SetComputeType(AgEFmCompute.eTotalTimeAbove)

    ' Get compute option compute interface
    Dim fomData As IAgFmDefDataMinAssets = TryCast(defComp.Compute, IAgFmDefDataMinAssets)
    fomData.MinAssets = 15
End If

Set the figure of merit definition to access constraint by name
[Visual Basic .NET] Copy Code
Dim defAccessCnstr As IAgFmDefAccessConstraint = fom.SetAccessConstraintDefinitionName("AzimuthRate")

' Confiure access constraint properties
defAccessCnstr.SetComputeType(AgEFmCompute.eMaximum)
defAccessCnstr.AcrossAssets = AgEFmAcrossAssets.eFmMinimum
defAccessCnstr.TimeStep = 60

Configure figure of merit definition altitude access constraint
[Visual Basic .NET] Copy Code
' Set access constraint defintion to altitude
fom.SetAccessConstraintDefinition(AgEFmConstraintName.eFmAltitude)

' Get IAgFmDefAccessConstraint interface
Dim defAccessCnstr As IAgFmDefAccessConstraint = TryCast(fom.Definition, IAgFmDefAccessConstraint)

' Confiure access constraint properties
defAccessCnstr.SetComputeType(AgEFmCompute.eMaximum)
defAccessCnstr.AcrossAssets = AgEFmAcrossAssets.eFmMinimum
defAccessCnstr.TimeStep = 60

Create a new Figure of Merit of type Access Duration
[MATLAB] Copy Code
% IAgCoverageDefinition coverage: Coverage object 
fom = coverage.Children.New('eFigureOfMerit', 'AccessDuration'); 
fom.SetDefinitionType('eFmAccessDuration'); 
fom.Definition.SetComputeType('eMaximum'); 
 
 
Configure the Contours of the FOM and define a color ramp
[MATLAB] Copy Code
% IAgCoverageDefinition coverage: Coverage object 
% IAgFigureOfMerit fom: Figure Of Merit object 
satisfaction = coverage.Graphics.Static; 
satisfaction.IsRegionVisible = false; 
Animation = fom.VO.Animation; 
Animation.IsVisible = false; 
VOcontours = fom.VO.Static; 
VOcontours.IsVisible = true; 
contours = fom.Graphics.Static.Contours; 
contours.IsVisible = true; 
contours.ContourType = 'eSmoothFill'; 
contours.ColorMethod = 'eColorRamp'; 
contours.LevelAttributes.RemoveAll; 
 
contours.LevelAttributes.AddLevelRange(590, 660, 10);   %Start, Start, Step 
contours.RampColor.StartColor = 255;        %Red 
contours.RampColor.EndColor = 16711680;     %Blue 
 
 

CoClasses that Implement IAgFigureOfMerit

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1