Search Blogs Blogs

Promoting AccessQuery over AccessComputation

By: mdunkel
There are two basic ways to calculate access in AGI Components. AccessComputation has existed since Components was first released and matches the implementation of access in STK very closely; You set the transmitter and receiver for the access calculation and then add all of the desired constraints. The downside to this approach is that AccessComputations cannot be extended in order to model access chains of more than two objects. In order to provide this capability, we added AccessQuery to AGI Components in 2008 r5. AccessQueries are very versatile and can be used to solve access problems of any size and shape. Since AccessQuery is able to solve any access problem that AccessComputation can, we made the decision to demote AccessComputation in 2010 r8. We rewrote our tutorials and demos to use AccessQuery rather than AccessComputation so that new customers are not introduced to two different methods of solving access. In addition we have made some changes to simplify the process of creating an Evaluator using an AccessQuery, the largest being that you no longer need to specify the observer if the access consists solely of instantaneous links. Due to the number of our customers who are still using AccessComputation, we are not currently deprecating it, although we do recommend that our users migrate to AccessQuery over AccessComputation. Here is an example of how you would rewrite an access problem consisting of multiple constraints attached to two platforms using an AccessQuery. In this we will have a receiver that can see a transmitter as long as three constraints are satisfied:
  1. The Earth is not blocking line of sight.
  2. The transmitter is between 500 meters and 100 kilometers away.
  3. The receiver can only track a target that has an angular rate of 2 degrees/second or less.
AccessComputation: Platform transmitter = CreateTransmitter(); Platform receiver = CreateReceiver(); CentralBody earth = CentralBodiesFacet.GetFromContext().Earth; //Create AccessComputation and assign Platforms AccessComputation computation = new AccessComputation(); computation.Transmitter = transmitter; computation.Receiver = receiver; //Add constraints computation.ReceiverConstraints.Add( new CentralBodyObstructionConstraint(earth)); computation.ReceiverConstraints.Add(new RangeConstraint(500, 100000)); computation.ReceiverConstraints.Add(new TotalAngularRateConstraint(0.0, 2.0 * Constants.RadiansPerDegree)); //Create Evaluator AccessEvaluator computationEval = computation.GetEvaluator(); AccessQuery: Platform transmitter = CreateTransmitter(); Platform receiver = CreateReceiver(); CentralBody earth = CentralBodiesFacet.GetFromContext().Earth; //Create link LinkInstantaneous link = new LinkInstantaneous(transmitter, receiver); //Create Constraints CentralBodyObstructionConstraint bodyConstraint = new CentralBodyObstructionConstraint(link, earth); RangeConstraint rangeConstraint = new RangeConstraint(link, 500, 100000); TotalAngularRateConstraint angleRateConstraint = new TotalAngularRateConstraint(link, LinkRole.Receiver, 0.0, 2.0 * Constants.RadiansPerDegree); //And constraints together, in .NET you can also use //the overloaded & operator. AccessQuery query = AccessQuery.And(bodyConstraint, rangeConstraint, angleRateConstraint); //Create Evaluator AccessEvaluator queryEval = query.GetEvaluator(); As you can see, the differences are minimal. When using AccessComputation, you assign the transmitter and receiver to the AccessComputation, then add all the constraints as either ReceiverConstraints or TransmitterConstraints. In the case of constraints that do not depend on the body they are applied to, such as CentralBodyObstructionConstraint and RangeConstraint, you can add the constraint to either collection. When using AccessQuery, you create a link out of the two Platforms and use that link to create the constraints. If necessary use a LinkRole object to specify which end of the link the constraint applies to as we did with the TotalAngularRateConstraint, above. Once the constraints are initialized, you add them all to an AccessQueryAnd object and create the evaluator from that. The power and flexibility of access queries come from the fact that the constraints can all be created with different links, which is not possible with AccessComputation. In addition you can combine these links into complicated structures with AccessQuery.And(), AccessQuery.Or(), AccessQuery.Not(), AccessQuery.AtLeastN(), AccessQuery.AtMostN(), and AccessQuery.ExactlyN(). For example, you can use AccessQuery.Or() to model whether a vehicle can connect with a cell tower at any point along a route, while AccessQuery.AtLeastN() can be used to model whether a UAV has access to at least four GPS satellites for an entire mission. Of course these AccessQueries can be chained together just like links to create pretty much any access network you need. For more information on AccessQueries and their capabilities see here.
Posted: 10/15/2010 3:17:11 PM