Intro_Course_5_1 - nasa/gunns GitHub Wiki

Intro Course 5.1: Networks in the Trick Sim Object

Implementation

We typically instantiate our GUNNS networks within a Trick Sim Object, though where you put your networks is up to you. We typically create separate sim objects by vehicle system (i.e. ECLSS vs. TCS vs. EPS), or by aspect (Fluid, Thermal, Electrical, Signal, etc). See Trick Sim Products: Sim Object Class for an example of what to put in the sim object.

A sim object can contain more than one GUNNS network, and may contain other objects besides GUNNS networks (such as signal aspect models).

Trick Jobs

GunnsDraw-generated networks are called directly from Trick jobs defined in the sim object. They use these 3 job types:

  • “initialization” job calls the network’s initialize method.
  • “restart” job calls the network’s restart method. You only need this if you are using checkpoint/restart.
  • “scheduled” job calls the network’s update method with the execution time step as an argument.

Object Naming

The networks, and most of the objects they contain, keep track of their instance names as a string. This is useful for identifying themselves in Health & Status messages (more on those later). If you have 50 valves in your network, and one of them is complaining about bad input data, then it helps if it can identify itself by the exact instance that has the problem, and not just “the valve class”. Otherwise you’d have to sift through 50 valve input data objects to find the offending value.

These name strings are built up from parent to child during initialization, and sometimes construction. it’s all automatic once it starts, but you have to give each network its name to kick the process off. So, if your top-level sim object name is, say, “eclss”, and the network instance is called “fluid” within that sim object, then you’d give the network its name as “eclss.fluid”. The intent of these names is to match how the objects look within Trick View, i.e. “sim_object.system.sybsystem.network.link.variable”, etc. That way when the name of an object shows up in a Health & Status message, you can easily find the object within Trick View to debug it.

You can see an example of how the network’s name is given it in the sim object code example linked above.

Previous Page / Next Page

⚠️ **GitHub.com Fallback** ⚠️