Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At the time of writing this tutorial Atomiton TQLEngine does not provide specific language constructs to implement simulation. But the existing Atomic domain languages capabilities can be exploited to achieve simple to complex simulation. The simulation design patterns can be classified as follows:

 

Pattern #NameDescriptionUse CasesImplementation Flow
1@ThingFacet LevelSeamless integration within the attribute's associate action
  • Simple Sensors and Actuators
  • JavaScript to capture simulation logic
  • Emulate automatic trigger for sensors
2@ThingFacet LevelSeparate Action to start the simulation
  • Simple Sensors and Actuators
  • JavaScript to capture simulation logic
  • Schedule frequency of simulation
3@Protocol Handler LevelPush the simulation logic down into protocol handler level
  • Complex simulation profiles can be passed
  • Automatically available at the Invoke level
  • Within Protocol Handler.
4@Behavior TreeSimulation logic is driven primarily by Behavior Trees.
  • Simulate a behavior
  • Within BDL Facet Instance

Simulating Temperature Sensor

...

Code Block
languagexml
titleFind Greenhouse
linenumberstrue
<Query>
  <Find>
    <Greenhouse>
      <GreenhouseID ne=""/>
    </Greenhouse>
  </Find>
</Query>
 
<!-- Custom container -->
<Query as="Khans.GreenDen">
  <Find>
    <Greenhouse>
      <GreenhouseID ne=""/>
    </Greenhouse>
  </Find>
</Query>
 
<!-- Filter the result -->
<Query as="Khans.GreenDen">
  <Find only="Greenhouse:ExternalEnv">
    <Greenhouse>
      <GreenhouseID ne=""/>
    </Greenhouse>
  </Find>
</Query>

 

Source Code

Import into TQLStudio

ProjectNameImport Link
Temp Sensor SerialSimulateTempSensor