Giter VIP home page Giter VIP logo

Comments (3)

bcoconni avatar bcoconni commented on May 23, 2024 1

@abassign

  1. According to your knowledge of the code JSBSim does an optimization of block processing by performing, for each step, only the blocks that have had at least one input modified with respect to the previous step? (It was on of the most powerful optimization criteria I had developed for the interpreter CSMP in APL)?

There is no optimization whatsoever in JSBSim regarding the execution of systems or channels. They are all unconditionally evaluated at each time step. At the moment, the only performance improvement feature that is available is the parameter execrate in the element <channel>.

  1. There are logical blocks (I have only seen the switch), such as a JK flip-flop, (although these days I saw that it is possible to emulate it with a switch used in sample-hold mode ...), but his presence would simplify the code and improve his reading.

I don't have the slightest idea of what a "JK flip-flop" is so I can hardly answer this one.

  1. I'm using the useful function execrate = "n" where n is a number of intervals between one execution and another of a channel. But I noticed a boring bug, that is, if there is a time-dependent block inside its value dt is not modified (should be multiplied by the execrate value present in the block) so as to make this function transparent and therefore be able to vary execrate without having to intervene in the code.

Elements in a <channel> should use the property simulation/channel-dt to get the corrected time step (i.e. simulation/dt times execrate).

The property simulation/dt always contain the true time step whatever execrate is. This is a feature not a bug so that a <channel> can always access whichever time step it needs (the true one or the corrected one). The idea is that if a <channel> needs to access data from outside the channel context, it can deduce the time step with which these data have been computed and apply the appropriate correction.

On the contrary, it would be interesting to have a variable execrate depending on some event, since certain blocks must be executed frequently only in certain phases of the flight.

Modifying execrate during execution would basically be equivalent to alter the channel time step in the course of the simulation. JSBSim has not been designed for that as it is assumed in many places of the code that the time step is constant.

  1. For the performance of JSBSim I can not complain because it is actually very fast and therefore consumes little CPU, but currently the tasks that I give are not many, I would like to know if someone has analyzed the performance problem with more depth, to understand the better optimization criteria.

There has been recently the commit e62022e by @zakalawe that was designed to improve JSBSim performance. However this is one of the very few patches for performance improvements that have been submitted in the recent years. This is certainly due to the fact that, as you mentioned, JSBSim is fast enough for most of our users; just fast enough that nobody is feeling the need to investigate for speed optimization.

In addition, there is the general trend from developers (at least myself 😄) to favor legible, easy-to-maintain code over high performance execution.

5.In Flightgear JSBSim runs in the same system thread, but being a separate application, with its own data that are exchanged only through a specialized process ... it would be very interesting to be able to run it on a separate thread, in order to use a different CPU . At this point the extended use, I would say aggressive, of JSBSim in Flightgear would be very interesting.

JSBSim can be executed in a separate process and use sockets to exchange data with FlightGear.
This can be achieved by declaring an external FDM to FlightGear

> fgfs --fdm=external --native-fdm=socket,in,120,,5550,udp --aircraft=Short_Empire --airport=SP01

and then running JSBSim in its own process

> JSBSim scripts/Short_S23_2.xml data_output/flightgear.xml --realtime --nice

However the communication is a one way transmission from JSBSim to FlightGear. Unfortunately JSBSim cannot receive data from FlightGear at the moment.

Unless someone volunteers to develop the C++ code for communication from FlightGear to JSBSim (that would be a new class inherited from FGInputSocket).

from jsbsim.

bcoconni avatar bcoconni commented on May 23, 2024

@abassign
Since you made no further comments, I guess your questions have been addressed and this issue can be closed ?

from jsbsim.

abassign avatar abassign commented on May 23, 2024

I think this request is complete, thank for your interest.

from jsbsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.