AGI STK Objects 11 Send comments on this topic.
IAgChain Interface
Windows






Windows & Linux

Description

Configuration options for chains.

Object Model








Public Methods

Public Method ClearAccessRemoves all chain accesses.
Public Method ComputeAccessComputes access for the chain.
Public Method ResetAccessIntervalsFileMethod to reset the .int file containing the strand access intervals.
Public Method SetAccessIntervalsFileOpt to produce an .int file containing the strand access intervals.
Public Method SetTimePeriodTypeMethod to set the option used to specify the time period.

Public Properties

Public Property AccessIntervalsFileName of the .int file containing the strand access intervals.
Public Property AutoRecomputeOpt to have STK automatically recompute accesses each time that an object on which the chain depends is updated.
Public Property ConstraintsGet the constraints applicable to the chain.
Public Property DataSaveModeSpecify the mode for saving or recomputing accesses.
Public Property DetectEventsBasedOnSamplesOnlyFlags control whether event times are computed just using the sampling or by sub-sampling
Public Property EnableLightTimeDelaySpecify whether to take light time delay into account in the computation.
Public Property EventDetectionEvent detection strategy used for access calculations.
Public Property GraphicsGet the 2D graphics properties of the chain.
Public Property MaxTimeStepThe maximum sampling step size used when computing the chain. The maximum step size limits the amount of time that is allowed to elapse between sampling of the constraint functions during access computations. Uses Time Dimension.
Public Property ObjectsGet the collection of objects in the chain.
Public Property SamplingSampling method used for access calculations.
Public Property TimeConvergenceThe time convergence for determining access intervals when computing the chain. Uses Time Dimension.
Public Property TimePeriodThe time period for the chain.
Public Property TimePeriodTypeGet the option used to specify the time period for the chain.
Public Property VOGet the 3D graphics properties of the chain.

Example

Create a chain (on the current scenario central body)
[C#]Copy Code
// Create the Chain on the current scenario central body (use 
// NewOnCentralBody to specify explicitly the central body) 
IAgChain chain = root.CurrentScenario.Children.New(AgESTKObjectType.eChain, "MyChain"as IAgChain; 
 

Define and compute a chain (basic)
[C#]Copy Code
// Add some objects to chain (using STK path) 
chain.Objects.Add("Facility/fac1"); 
chain.Objects.Add("Satellite/sat1"); 
chain.Objects.Add("Satellite/sat2"); 
chain.Objects.Add("Aircraft/air1"); 
 
// Compute the chain 
chain.ComputeAccess(); 
 

Define and compute a chain (advance)
[C#]Copy Code
// Remove all previous accesses 
chain.ClearAccess(); 
 
// Add some objects to chain 
chain.Objects.Add("Facility/fac1"); 
chain.Objects.Add("Satellite/sat1"); 
chain.Objects.Add("Satellite/sat2"); 
chain.Objects.Add("Aircraft/air1"); 
 
// Configure chain parameters 
chain.AutoRecompute = false
chain.EnableLightTimeDelay = false
chain.TimeConvergence = 0.001
chain.DataSaveMode = AgEDataSaveMode.eSaveAccesses; 
 
// Specify our own time period 
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod); 
 
// Get chain time period interface 
IAgChUserSpecifiedTimePeriod chainUserTimePeriod = chain.TimePeriod as IAgChUserSpecifiedTimePeriod; 
chainUserTimePeriod.SetTimePeriod("1 Jul 2005 12:00:00""2 Jul 2005 12:00:00"); 
 
// Compute the chain 
chain.ComputeAccess(); 
 

Configure the chain compute time period.
[C#]Copy Code
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod); 
IAgChUserSpecifiedTimePeriod userSpecifiedTimePeriod = chain.TimePeriod as IAgChUserSpecifiedTimePeriod; 
userSpecifiedTimePeriod.TimeInterval.SetExplicitInterval("1 May 2015 04:00:00.000""1 May 2015 05:00:00.000"); 
 

Prints the strand intervals of chain object
[C#]Copy Code
IAgStkObject chainAsStkObject = chain as IAgStkObject; 
 
// Compute the chain access if not done already. 
chain.ComputeAccess(); 
 
// Considered Start and Stop time 
Console.WriteLine("Chain considered start time: {0}", chainAsStkObject.Vgt.Events["ConsideredStartTime"].FindOccurrence().Epoch); 
Console.WriteLine("Chain considered stop time: {0}", chainAsStkObject.Vgt.Events["ConsideredStopTime"].FindOccurrence().Epoch); 
 
IAgCrdnEventIntervalCollection objectParticipationIntervals = chainAsStkObject.Vgt.EventIntervalCollections["StrandAccessIntervals"]; 
IAgCrdnIntervalsVectorResult intervalListResult = objectParticipationIntervals.FindIntervalCollection(); 
 
for (int i = 0; i < intervalListResult.IntervalCollections.Count; ++i) 

    if (intervalListResult.IsValid) 
    { 
        Console.WriteLine("Link Name: {0}", objectParticipationIntervals.Labels.GetValue(i)); 
        Console.WriteLine("--------------"); 
        for (int j = 0; j < intervalListResult.IntervalCollections[i].Count; ++j) 
        { 
            object startTime = intervalListResult.IntervalCollections[i][j].Start; 
            object stopTime = intervalListResult.IntervalCollections[i][j].Stop; 
            Console.WriteLine("Start: {0}, Stop: {1}", startTime, stopTime); 
        } 
    } 

 

Create a chain (on the current scenario central body)
[Visual Basic .NET]Copy Code
' Create the Chain on the current scenario central body (use
' NewOnCentralBody to specify explicitly the central body)
Dim chain As IAgChain = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eChain, "MyChain"), IAgChain)

Define and compute a chain (basic)
[Visual Basic .NET]Copy Code
' Add some objects to chain (using STK path)
chain.Objects.Add("Facility/fac1")
chain.Objects.Add("Satellite/sat1")
chain.Objects.Add("Satellite/sat2")
chain.Objects.Add("Aircraft/air1")

' Compute the chain
chain.ComputeAccess()

Define and compute a chain (advance)
[Visual Basic .NET]Copy Code
' Remove all previous accesses
chain.ClearAccess()

' Add some objects to chain
chain.Objects.Add("Facility/fac1")
chain.Objects.Add("Satellite/sat1")
chain.Objects.Add("Satellite/sat2")
chain.Objects.Add("Aircraft/air1")

' Configure chain parameters
chain.AutoRecompute = False
chain.EnableLightTimeDelay = False
chain.TimeConvergence = 0.001
chain.DataSaveMode = AgEDataSaveMode.eSaveAccesses

' Specify our own time period
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod)

' Get chain time period interface
Dim chainUserTimePeriod As IAgChUserSpecifiedTimePeriod = TryCast(chain.TimePeriod, IAgChUserSpecifiedTimePeriod)
chainUserTimePeriod.SetTimePeriod("1 Jul 2005 12:00:00", "2 Jul 2005 12:00:00")

' Compute the chain
chain.ComputeAccess()

Configure the chain compute time period.
[Visual Basic .NET]Copy Code
chain.SetTimePeriodType(AgEChTimePeriodType.eUserSpecifiedTimePeriod)
Dim userSpecifiedTimePeriod As IAgChUserSpecifiedTimePeriod = TryCast(chain.TimePeriod, IAgChUserSpecifiedTimePeriod)
userSpecifiedTimePeriod.TimeInterval.SetExplicitInterval("1 May 2015 04:00:00.000", "1 May 2015 05:00:00.000")

Prints the strand intervals of chain object
[Visual Basic .NET]Copy Code
Dim chainAsStkObject As IAgStkObject = TryCast(chain, IAgStkObject)

' Compute the chain access if not done already.
chain.ComputeAccess()

' Considered Start and Stop time
Console.WriteLine("Chain considered start time: {0}", chainAsStkObject.Vgt.Events("ConsideredStartTime").FindOccurrence().Epoch)
Console.WriteLine("Chain considered stop time: {0}", chainAsStkObject.Vgt.Events("ConsideredStopTime").FindOccurrence().Epoch)

Dim objectParticipationIntervals As IAgCrdnEventIntervalCollection = chainAsStkObject.Vgt.EventIntervalCollections("StrandAccessIntervals")
Dim intervalListResult As IAgCrdnIntervalsVectorResult = objectParticipationIntervals.FindIntervalCollection()

Dim i As Integer = 0
While i <>
    If intervalListResult.IsValid Then
        Console.WriteLine("Link Name: {0}", objectParticipationIntervals.Labels.GetValue(i))
        Console.WriteLine("--------------")
        Dim j As Integer = 0
        While j <>
            Dim startTime As Object = intervalListResult.IntervalCollections(i)(j).Start
            Dim stopTime As Object = intervalListResult.IntervalCollections(i)(j).[Stop]
            Console.WriteLine("Start: {0}, Stop: {1}", startTime, stopTime)
            System.Threading.Interlocked.Increment(j)
        End While
    End If
    System.Threading.Interlocked.Increment(i)
End While

Create a chain (on the current scenario central body)
[MATLAB]Copy Code
% IAgStkObjectRoot root: STK Object Model Root 
% Create the Chain on the current scenario central body (use 
% NewOnCentralBody to specify explicitly the central body) 
chain = root.CurrentScenario.Children.New('eChain', 'MyChain'); 
 
 
Define and compute a chain (basic)
[MATLAB]Copy Code
% IAgChain chain: Chain object 
 
% Add some objects to chain (using STK path) 
chain.Objects.Add('Facility/MyFacility'); 
chain.Objects.Add('Satellite/MySatellite'); 
 
% Compute the chain 
chain.ComputeAccess(); 
 
 
Define and compute a chain (advance)
[MATLAB]Copy Code
% IAgChain chain: Chain object 
% IAgSatellite satellite: Satellite object 
 
% Remove all previous accesses 
chain.ClearAccess(); 
 
% Add some objects to chain 
chain.Objects.Add('Facility/MyFacility'); 
chain.Objects.AddObject(satellite); 
 
% Configure chain parameters 
chain.AutoRecompute = false; 
chain.EnableLightTimeDelay = false; 
chain.TimeConvergence = 0.001; 
chain.DataSaveMode = 'eSaveAccesses'; 
 
% Specify our own time period 
chain.SetTimePeriodType('eUserSpecifiedTimePeriod'); 
 
% Get chain time period interface 
chainUserTimePeriod = chain.TimePeriod; 
chainUserTimePeriod.SetTimePeriod(root.CurrentScenario.StartTime, root.CurrentScenario.StopTime); % Set to scenario period 
 
% Compute the chain 
chain.ComputeAccess(); 
 
 
Prints the strand intervals of chain object
[MATLAB]Copy Code
% IAgChain chain: Chain Object 
% Compute the chain access if not done already. 
chain.ComputeAccess(); 
 
% Considered Start and Stop time 
disp(['Chain considered start time: ' chain.Vgt.Events.Item('ConsideredStartTime').FindOccurrence.Epoch]); 
disp(['Chain considered stop time: ', chain.Vgt.Events.Item('ConsideredStopTime').FindOccurrence.Epoch]); 
 
objectParticipationIntervals = chain.Vgt.EventIntervalCollections.Item('StrandAccessIntervals'); 
intervalListResult = objectParticipationIntervals.FindIntervalCollection(); 
 
for i = 0:intervalListResult.IntervalCollections.Count -1 
 
    if intervalListResult.IsValid 
 
        disp(['Link Name: ' objectParticipationIntervals.Labels(i+1)]); 
        disp('--------------'); 
        for j = 0:intervalListResult.IntervalCollections.Item(i).Count - 1 
 
            startTime = intervalListResult.IntervalCollections.Item(i).Item(j).Start; 
            stopTime = intervalListResult.IntervalCollections.Item(i).Item(j).Stop; 
            disp(['Start: ' startTime ' Stop: ' stopTime]); 
        end 
    end 
end 
 
 
Create a chain (on the current scenario central body)
[Python]Copy Code
# IAgStkObjectRoot root: STK Object Model Root 
# Create the Chain on the current scenario central body (use 
# NewOnCentralBody to specify explicitly the central body) 
chain = root.CurrentScenario.Children.New(4, 'MyChain') # eChain 
 
 
Define and compute a chain (basic)
[Python]Copy Code
# IAgChain chain: Chain object 
 
# Add some objects to chain (using STK path) 
chain.Objects.Add('Facility/MyFacility') 
chain.Objects.Add('Satellite/MySatellite') 
 
# Compute the chain 
chain.ComputeAccess() 
 
 
Define and compute a chain (advanced)
[Python]Copy Code
# IAgChain chain: Chain object 
# IAgSatellite satellite: Satellite object 
 
# Remove all previous accesses 
chain.ClearAccess() 
 
# Add some objects to chain 
chain.Objects.Add('Facility/MyFacility') 
chain.Objects.AddObject(satellite) 
 
# Configure chain parameters 
chain.AutoRecompute = False 
chain.EnableLightTimeDelay = False 
chain.TimeConvergence = 0.001 
chain.DataSaveMode = 2 # eSaveAccesses 
 
# Specify our own time period 
chain.SetTimePeriodType(2) # eUserSpecifiedTimePeriod 
 
# Get chain time period interface 
chainUserTimePeriod = chain.TimePeriod 
chainUserTimePeriod.SetTimePeriod(root.CurrentScenario.StartTime, root.CurrentScenario.StopTime) # Set to scenario period 
 
# Compute the chain 
chain.ComputeAccess() 
 
 
Prints the strand intervals of chain object
[Python]Copy Code
# IAgChain chain: Chain Object 
# Compute the chain access if not done already. 
chain.ComputeAccess() 
 
# Considered Start and Stop time 
print('Chain considered start time: #s' # chain.Vgt.Events.Item('ConsideredStartTime').FindOccurrence().Epoch) 
print('Chain considered stop time: #s' # chain.Vgt.Events.Item('ConsideredStopTime').FindOccurrence().Epoch) 
 
objectParticipationIntervals = chain.Vgt.EventIntervalCollections.Item('StrandAccessIntervals') 
intervalListResult = objectParticipationIntervals.FindIntervalCollection() 
 
for i in range(0,intervalListResult.IntervalCollections.Count): 
 
    if intervalListResult.IsValid: 
 
        print('Link Name: #s' # objectParticipationIntervals.Labels(i+1)) 
        print('--------------') 
        for j in range(0,intervalListResult.IntervalCollections.Item(i).Count): 
 
            startTime = intervalListResult.IntervalCollections.Item(i).Item(j).Start 
            stopTime = intervalListResult.IntervalCollections.Item(i).Item(j).Stop 
            print('Start: #s Stop: #s' # (startTime, stopTime)) 
 
 

CoClasses that Implement IAgChain

Name
AgChain
© 2018 Analytical Graphics, Inc. All Rights Reserved.