STK ObjectsSend comments on this topic.
IAgFigureOfMerit Interface

Description

Figure of Merit properties.

Public Methods

Public Method IsDefinitionTypeSupportedGets a value indicating whether the specified type can be used.
Public Method SetAccessConstraintDefinitionSet the access constraint definition.
Public Method SetAccessConstraintDefinitionNameSet the access constraint definition by name.
Public Method SetDefinitionTypeSet the definition type.
Public Method SetScalarCalculationDefinitionSet the scalar calculation definition.

Public Properties

Public Property DefinitionDefinition properties of the FOM.
Public Property DefinitionSupportedTypesReturns an array of valid choices.
Public Property DefinitionTypeDefinition type for the FOM.
Public Property Graphics2D graphics properties of the FOM.
Public Property GridInspectorThe Grid inspector tool.
Public Property VO3D graphics properties of the FOM.

Interfaces

CoClasses that Implement IAgFigureOfMerit

Example

Create a figure of merit on a coverage definition
[C#]
// 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#]
// Set figure of merit definition 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#]
// Set figure of merit definition 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#]
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#]
// Set access constraint definition 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]
' 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]
' Set figure of merit definition 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]
' Set figure of merit definition 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]
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]
' Set access constraint definition 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
[Python - STK API]
# IAgCoverageDefinition coverage: Coverage object
fom = coverage.Children.New(AgESTKObjectType.eFigureOfMerit, 'AccessDuration')
fom.SetDefinitionType(AgEFmDefinitionType.eFmAccessDuration)
fom.Definition.SetComputeType(AgEFmCompute.eMaximum)

Configure the Contours of the FOM and define a color ramp
[Python - STK API]
# 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 = AgEFmGfxContourType.eSmoothFill
contours.ColorMethod = AgEFmGfxColorMethod.eColorRamp
contours.LevelAttributes.RemoveAll()

contours.LevelAttributes.AddLevelRange(590, 660, 10)   # Start, Start, Step
contours.RampColor.StartColor = Colors.Red
contours.RampColor.EndColor = Colors.Blue

Create a new Figure of Merit of type Access Duration
[MATLAB]
% 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]
% 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


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.