What is a Logic? Real tools for virtual worlds vsTASKER Presentation From the toolbar, the user...
-
Upload
joseph-byrd -
Category
Documents
-
view
217 -
download
1
Transcript of What is a Logic? Real tools for virtual worlds vsTASKER Presentation From the toolbar, the user...
What is a Logic?Real tools for virtual worlds
vsTASKER PresentationFrom the toolbar, the user
selects which logical Object to use to design a Logic in order to define a behavior.
Here the first object to be called after Start is Task Fly.
A Task runs at a given frequency and executes the
embedded user code
Then, if a condition is triggered (detection of an enemy), the Task Fly will
be left and the Face Target Action will be
activated
Then, as soon as the detected entity is in the line-of-sight, Fire and
Evade Actions are immediately triggered.
A Logic in vsTASKER is a graphical representation of a behavior or a reaction, expressed using logical Objects organized and linked together, in such a way that the whole defines a logical sequence of acts.
Real tools for virtual worlds
vsTASKER Presentation
What is an Object?
The C++ user-code will be compiled and linked with vsTASKER and 3rd party
application libraries, allowing direct access to all of the public data, objects and published interface.
All Objects (here, a Task) have a property window with several tabs
where the user can parameterize the object behavior and, more
importantly, add his own C++ code.
Real tools for virtual worlds
vsTASKER Presentation
What are the Objects?A Task is an ongoing
process that runs at a given frequency and stops on
user conditions
An Action is similar to a Task but is processed
only once.
A Link connects an ongoing process object to another object.
A Link is activated by different kind of user conditions.
A Delay stops the logical flow until one of the
embedded user condition triggers
A Choice triggers the Yes or No branch according to
the embedded user condition.
A Splitter divides the logical flow into two branches that
will be processed in parallel.
A Synchro stops the logical flow until all the
input branches have been activated.
A Group encapsulates other objects and groups. It is used
to hide a behavior implementation. It behaves like
a Task object.
Real tools for virtual worlds
vsTASKER Presentation
What are conditions?
Logical Objects are triggered on several circumstances:
-Immediately;- On Time; - On Facts/Events;- On Condition;
Time based activation is expressed in hh:mm:ss.
It can be absolute time, relative time or a number a simulation
cycles.
Events or Facts can be listed here. As soon as an Event is thrown or a Fact is added in a fact database, the condition is
triggered.C++ user-code can also become a
condition for triggering. The C++ bloc is a function body that must
return True or False.
The user has flexibility to define a simple or very complex condition.
Real tools for virtual worlds
vsTASKER Presentation
What is a Knowledge?
vsTASKER provides also a declarative way for triggering behaviors.
Instead of following a predefined logical path (like with Logics), the behavior designer can define a set of Rules that will or won’t trigger.
A Knowledge can: Initiate Logics
Add Facts into a fact database
Throw Events
Real tools for virtual worlds
vsTASKER Presentation
What is a Context?
Each Context contains one or several Rules that are checked continuously, at a
frequency specified by the user, until one if fired.
When a Rule is fired, it can stay Off or be reactivated after a delay or from another rule.
A Knowledge can contain one or many Contexts.
A Context gathers rules belonging to the same domain of expertise.
Real tools for virtual worlds
vsTASKER Presentation
What is a Rule?
In a Rule, the user must add his own C++ code based on the vsTASKER API, data access or any 3rd party API or public data.
The IF part must evaluate True or False according to the C++ expression syntax. This expression will be continuously checked until the Then or Else part can be triggered.
The Then part can be formed with several C++ terms.
The Else part is optional but if defined, will trigger the rule the same way as the Then part.
After Fire defines the reactivation condition for the rule.
Real tools for virtual worlds
vsTASKER Presentation
What is a Fact?
In vsTASKER, a Fact is a persistent Event. Its existence can be unlimited or time limited.
A fact can trigger objects the same way as an Event does, but most importantly, is stored into a database.
vsTASKER defines Fact Db at several levels:- Context level;- Knowledge level;- Entity level;- Scenario level.
From the user-code, it is easy to manipulate facts or to query a specific Fact database.
Real tools for virtual worlds
vsTASKER Presentation
What is a Model?
Models allow the user to define runtime Components and Objects to implement physical modeling like Dynamic, Road Following, Sensors, Weapons, etc.
Models are made of Components and Objects grouped according to their purposes and using each others, thru inheritance or incorporation.
Real tools for virtual worlds
vsTASKER Presentation
What is a Component?
A Component comes with everything needed to define a
C++ Class.
It adds a runtime routine that will be called automatically.
To make this Component works, extra code will be added
automatically by vsTASKER at code generation time.
Any Component can then be attached to any Entity and
be locally setup.
Real tools for virtual worlds
vsTASKER Presentation
What is a Model Object?
A Model Object is like a Component but without the runtime routine and without all the mechanisms needed to be attached to an Entity.
A Model Object is a C++ Class that can be used
anywhere.
Objects and Components can be set Private and
then, be defined and used with a header file and an external library or DLL.
Data InterfaceReal tools for virtual worlds
vsTASKER Presentation
User can insert directly into the vsTASKER code,
commands to generate automatic GUI interface
vsTASKER generates automatically a user value editor table for all variables
marked as “Interface”.
HLAReal tools for virtual worlds
vsTASKER Presentation
vsTASKER supports HLA based on Pitch & KD RTI Vendors.
1516 & 1.3 are supported.
vsTASKER does not request any particular FOM. Any one can be
imported and loaded.
User can select any Object or Interaction from the FOM and add its
own code to send data or process received one from other federates.
FederatesReal tools for virtual worlds
vsTASKER Presentation
Sending a vsTASKER value to other Federates is that simple.
Here, setting Object Attribute “Damages” with value 100
Retrieving data from Attribute or Interaction is
also trivial.
SocketsReal tools for virtual worlds
vsTASKER Presentation
Mean of communication between vsTASKER and other simulator systems (or another
vsTASKER Sim Engine) can be defined very easily.
With vsTASKER graphical Sockets, it is very easy to setup a communication channel and control it. User can setup as many
channels as requested using TCP or UDP protocol.
Also, symbols change colors in real-time as an indicator of their status (idle, connecting, connected, receiving data…)
AggregatesReal tools for virtual worlds
vsTASKER Presentation
Entities can be grouped as Aggregates (or Unit), mounted or
dismounted.
Any entity can join or leave a Unit, at design or runtime.
Real tools for virtual worlds
vsTASKER Presentation
What is an Entity?
Every Entity belonging to a scenario can have a behavior (or
intelligence) defined by one or several Logics and/or one or
several Knowledge.
An Entity is a virtual representation of a physical
platform (boat, airplane, land vehicle) or a human being or any non material
object that reacts to its environment.
Real tools for virtual worlds
vsTASKER Presentation
What is a Scenario?
A Scenario gathers all the Entities involved in the simulation, for a
given exercise.
A vsTASKER database can contain several scenarios and
each of them can contain different sets of entities.
Real tools for virtual worlds
vsTASKER Presentation
What is user-code?
In vsTASKER, each logical object can hold C++ user-code based on method calls and data processing.
Local Groups, Logics, Knowledge and Contexts basic classes can be expanded with user-defined methods and data.
Scenario and Entity Sources allow also the user to expand the Global class definition for Scenario and Entity classes.
Global Source allow definition of data structures and functions not pertaining to any class.
User-CommandsReal tools for virtual worlds
vsTASKER Presentation
User-Commands generates automatic GUI pull down menus. They are also available in
the Entity Hook-Window.
Minimum coding allows specialization of the simulation system avoiding complex
extensions of predefined black-box behaviors.
Because sequences of actions can be triggered manually, vsTASKER lets the
user to define his own commands.
Specific user-code can then be triggered with runtime user-data, for any selected
Scenario or Entity.
ViewersReal tools for virtual worlds
vsTASKER Presentation
Viewers are predefined Objects that provide to the Simulation Engine a way to generate
outputs.
Basic default Viewer is a Console.
Some other specialized Viewers are provided OTB like OpenGL or Google-Earth.
The user can create his own if he wants vsTASKER to be connected to a perticular output system (typically, a 3D engine) or
integrated with a third party software.
Predefined objects can also be user customized.
Real tools for virtual worlds
vsTASKER Presentation
How to generate code?
Clicking on this button translates all the Logics, Knowledge, Entities and
Scenarios graphical descriptions into C++ code. This process also embed the added user-
code.
Each vsTASKER database produces 3 files, ready to be compiled and linked:
- 1 header file- 1 interface module- 1 user-code module
By pressing this button, the generated code is then
compiled and linked with vsTASKER libraries and any other 3rd party modules and
libraries.
The produced executable can be run from vsTASKER GUI or
from the command line, without a need of a license.
Real tools for virtual worlds
vsTASKER Presentation
Running a simulation
Once the executable has been created, it can be
loaded from vsTASKER GUI on a mouse-click.
Then, any scenario in the database can be selected manually before starting
the simulation.
Like standard real-time simulation, the
runtime-engine can be frozen, released or
stopped.Simulation rate can be
changed using the slider to increase or decrease the number of cycles per second.
Of course, these manual actions can be replaced with API calls.
Using the public API to remote-control the load of a scenario, the start, freeze, stop and change of the simulation rate is easy and mandatory to embed the generated behavior code into a 3rd party application.
Real tools for virtual worlds
vsTASKER Presentation
How to monitor it?
During runtime, the vsTASKER GUI can be used to monitor Logics &
Knowledge executions.
Magenta color is used to show instant status of execution, like:
which object is running, which branch has been followed, where the
execution is pending…
Real tools for virtual worlds
vsTASKER Presentation
How to debug code?
Using Microsoft Visual C++, it is easy to debug a Behavior (Logic or
Knowledge) because the user-code is traceable.
Just by adding the 3 generated files in the template VC++ Workspace
provided with vsTASKER, execution can be monitored and debugged the
same way as a standard hand-written application.
Break-Points can be set anywhere in the automatically generated code (based on the graphical description) or in the user-added code (embedded into objects or expanding the
basic vsTASKER classes)
Real tools for virtual worlds
vsTASKER Presentation
Integration made-easy
In this example, the 3rd party application data and API have been opened to vsTASKER code.
Any Logic or Knowledge object can then access, use or refer to the 3rd party application data or API directly, without the overhead of a
complex and slow gateway.
Because vsTASKER generates standalone C++ code, integration with another 3rd party application is straightforward!
On the link side, to generate an executable that gathers vsTASKER
behavior code, libraries and the 3rd party application
libraries, the user just have to specify what needs to be
included.
Real tools for virtual worlds
vsTASKER Presentation
Master or Slave?
If vsTASKER is using its embedded real-time controller
(RTC), the user can select between to RTC modes:
- Real-Time- Asynchronous
With Real-Time mode, specifying the frequency (in Hz)
is enough to request a certain number of cycles per real-time
second (if CPU permits).
With Asynchronous mode, the user specifies the integration time value (time used per cycle) and the wait time (idle
time after processing).
Asynchronous mode allows faster than real-time without loss of accuracy.
The RTC can run in Master or Slave mode.
Master: every cycle is triggered by an internal clock mechanism.
Slave: an external application must call the RTC at every cycle.
Real tools for virtual worlds
vsTASKER Presentation
Thank you for attending!