Giter Club home page Giter Club logo

irritator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

irritator's Issues

Output cannot be saved in file (windows version)

Hi
My version of irritator is recent (2 days) and installed on windows 10
After having selected output directory (D:\irritator in my case, D: being the installation disk, changing output location on C: crashes anyway) the simulation does nothing when components should observe in files (third radiobutton selected).
I can't get any file in the selected directory at the end of simulation.
Could it be due to dos directory names with \ ?
Thanks for any clue
Yves

Observation of aggregated values

It would be useful to have observations that combine observations on several
component instances. For example, on a grid, an observation that combines the
values of the same QSS integrators of each cell (sum of prey and predator for
lotka volterra).

Flow and filter models : core dumped.

Adding a flow or a filter model in the editor cause a core dumped.

  • While adding a "filter" model, I got this from gdb:
    Thread 1 "irritator-0.1" received signal SIGTRAP, Trace/breakpoint trap. 0x00005555555692e4 in irt::flow::initialize() ()
    It seems it is a wrong function call.

  • While adding a "flow" model, I got exactly the same message from gdb.

-Wparentheses warning in node-editor.cpp

irritator/app/gui/node-editor.cpp:790:30: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first
+[-Wparentheses]
      line + (remaining > 0) ? settings.automatic_layout_y_distance : 0.f;
      ~~~~~~~~~~~~~~~~~~~~~~ ^
irritator/app/gui/node-editor.cpp:790:30: note: place parentheses around the '+' expression to silence this warning
      line + (remaining > 0) ? settings.automatic_layout_y_distance : 0.f;
                             ^
      (                     )
irritator/app/gui/node-editor.cpp:790:30: note: place parentheses around the '?:' expression to evaluate it first
      line + (remaining > 0) ? settings.automatic_layout_y_distance : 0.f;

Homogeneize size, ssize

To simplify code in containers:

  • size() member function return a size_t
  • ssize() memebr function return a i32

irritator crashed

Right after launching irritator, adding a "flow" model in the editor window (right clic) cause a crash.

SEIR Model doesn't exhibit the right behavior

The QSS1 SEIR Model doesn't exhibit the right behavior. It shows an exponential growth which is unexpected. Hereafter is a screenshot of what should be the results (using QSS2).
Capture d’écran de 2021-06-25 15-20-13

I copy the irt source file for you to check :

0
0
0
0
33
0 0.0 0.0 qss2_integrator 999 0.01
1 0.0 0.0 qss2_integrator 1 0.01
2 0.0 0.0 qss2_integrator 1 0.01
3 0.0 0.0 qss2_integrator 0 0.01
4 0.0 0.0 constant 16.667
5 0.0 0.0 qss2_sum_2
6 0.0 0.0 qss2_multiplier
7 0.0 0.0 qss1_multiplier
8 0.0 0.0 constant 0.001
9 0.0 0.0 constant 1
10 0.0 0.0 qss2_multiplier
11 0.0 0.0 qss2_multiplier
12 0.0 0.0 constant 0.3
13 0.0 0.0 qss2_multiplier
14 0.0 0.0 constant -1
15 0.0 0.0 qss2_multiplier
16 0.0 0.0 constant -0.01667
17 0.0 0.0 qss2_sum_2
18 0.0 0.0 qss2_multiplier
19 0.0 0.0 constant 0.1
20 0.0 0.0 qss2_multiplier
21 0.0 0.0 constant -1
22 0.0 0.0 qss2_sum_2
23 0.0 0.0 qss2_sum_2
24 0.0 0.0 qss1_sum_2
25 0.0 0.0 qss2_multiplier
26 0.0 0.0 constant 0.1
27 0.0 0.0 qss2_multiplier
28 0.0 0.0 constant -1
29 0.0 0.0 qss2_multiplier
30 0.0 0.0 qss2_sum_2
31 0.0 0.0 qss2_multiplier
32 0.0 0.0 qss2_sum_2
0 0 15 0
0 0 6 0
1 0 18 0
1 0 6 1
2 0 29 1
2 0 25 0
3 0 31 0
4 0 5 1
5 0 17 1
6 0 7 0
7 0 10 0
8 0 7 1
9 0 10 1
10 0 11 0
11 0 23 1
11 0 13 0
12 0 11 1
13 0 5 0
14 0 13 1
15 0 17 0
16 0 31 1
16 0 29 0
16 0 15 1
17 0 0 0
18 0 24 0
18 0 20 0
19 0 18 1
20 0 22 1
21 0 20 1
22 0 23 0
23 0 1 0
24 0 2 0
25 0 32 0
25 0 27 0
26 0 25 1
27 0 30 0
28 0 27 1
29 0 30 1
30 0 24 1
31 0 32 1
32 0 3 0

Crash

After unchecking the box "lock windows" in the "view" menu, irritator crashes if we try to resize main or components list window.

(gdb) bt
#0 0x00007ffff7a46a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff79f2476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff79d87f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff79d871b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff79e9e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00005555556ebe0c in ImGui::ErrorCheckEndFrameSanityChecks() ()
#6 0x00005555556dfb11 in ImGui::EndFrame() ()
#7 0x00005555556dff72 in ImGui::Render() ()
#8 0x000055555579217d in main ()

(gdb) cont
Program terminated with signal SIGABRT, Aborted.

Crash : can not import model into simulation tab.

Irritator crashes when I select QSS 2 lotka-volterra (right panel), then check observation boxes for X et Y (left panel), then select import model in the simulation tab.
Hereafter the back trace with gdb:

(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff7a25537 in __GI_abort () at abort.c:79
#2 0x00007ffff7a2540f in __assert_fail_base (fmt=0x7ffff7b8e128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x555555791b3f "obs",
file=0x5555557991e0 "/home/raph/vle/irritator/app/gui/simulation-component.cpp", line=269, function=) at assert.c:92
#3 0x00007ffff7a34662 in __GI___assert_fail (assertion=0x555555791b3f "obs", file=0x5555557991e0 "/home/raph/vle/irritator/app/gui/simulation-component.cpp",
line=269, function=0x555555799368 "irt::status irt::simulation_init_observation(irt::simulation_editor&, irt::tree_node&, irt::component&)")
at assert.c:101
#4 0x000055555566d64c in irt::simulation_init_observation(irt::simulation_editor&, irt::tree_node&, irt::component&) ()
#5 0x000055555566d8bc in irt::simulation_init_observation(irt::component_editor&, irt::simulation_editor&, irt::tree_node&) ()
#6 0x000055555566dcbe in irt::simulation_copy(irt::component_editor&, irt::simulation_editor&) ()
#7 0x000055555566e0f8 in irt::simulation_copy_impl(void*) ()
#8 0x000055555556c867 in irt::worker::run() ()
#9 0x000055555559bf65 in void std::__invoke_impl<void, void (irt::worker::)() noexcept, irt::worker>(std::__invoke_memfun_deref, void (irt::worker::&&)() noexcept, irt::worker&&) ()
#10 0x000055555559bd8d in std::__invoke_result<void (irt::worker::)() noexcept, irt::worker>::type std::__invoke<void (irt::worker::)() noexcept, irt::worker>(void (irt::worker::&&)() noexcept, irt::worker&&) ()
#11 0x000055555559bca3 in void std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) ()
#12 0x000055555559bb3c in std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> >::operator()() ()
#13 0x000055555559b6b0 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> > >::_M_run() ()
#14 0x00007ffff7df3ed0 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#15 0x00007ffff7f26ea7 in start_thread (arg=) at pthread_create.c:477
#16 0x00007ffff7afddef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Crash with view setting

Irritator crashes after the following actions:

  • unselect "View" -> "Fix window layout".
  • Reduce the "Component library" window by clicking the invert triangle left to the window's name.

gdb backtrace:
#0 0x00007ffff7a46a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff79f2476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff79d87f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff79d871b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff79e9e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x0000555555b8e74a in ImGui::ErrorCheckEndFrameSanityChecks() ()
#6 0x0000555555b8244f in ImGui::EndFrame() ()
#7 0x0000555555b828b0 in ImGui::Render() ()
#8 0x0000555555c34322 in main ()

Allocator -> noexcept and never return nullptr

  • allocator never return nullptr and never throw exception
  • allocator need parameter 'heat' parameter (cold: memory never deallocate like path, models etc. hot: quickly allocate/deallocate memory sush as i/o table etc.)

Split hierarchical state machine: model/simulation

Move all simulation/execution variables into hsm_wrapper:

  • no need to provide hierarchical_state_machine class in show_dynamics_inputs
  • several hsm_wrapper can use the same hierarchical_state_machine

crash: visualization does not work

Can not observe simulation results in output editor window.

Actions : Select lotka-volterra QSS2, check observation for X variable, import model in simulation tab -> crash

(gdb) bt
#0 0x00007ffff7a46a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff79f2476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff79d87f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff79d871b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff79e9e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x000055555568447c in irt::simulation_init_observation(irt::simulation_editor&, irt::tree_node&, irt::component&) ()
#6 0x0000555555684745 in irt::simulation_init_observation(irt::component_editor&, irt::simulation_editor&, irt::tree_node&) ()
#7 0x0000555555684b7c in irt::simulation_copy(irt::component_editor&, irt::simulation_editor&) ()
#8 0x000055555568500b in irt::simulation_copy_impl(void*) ()
#9 0x000055555556dbc1 in irt::worker::run() ()
#10 0x00005555555a25b9 in void std::__invoke_impl<void, void (irt::worker::)() noexcept, irt::worker>(std::__invoke_memfun_deref, void (irt::worker::&&)() noexcept, irt::worker&&) ()
#11 0x00005555555a2375 in std::__invoke_result<void (irt::worker::)() noexcept, irt::worker>::type std::__invoke<void (irt::worker::)() noexcept, irt::worker>(void (irt::worker::&&)() noexcept, irt::worker&&) ()
#12 0x00005555555a2273 in void std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>)
()
#13 0x00005555555a20f4 in std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> >::operator()() ()
#14 0x00005555555a1c50 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (irt::worker::)() noexcept, irt::worker> > >::_M_run() ()
#15 0x00007ffff7dbd2c3 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#16 0x00007ffff7a44b43 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#17 0x00007ffff7ad6a00 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

QSS1, 2 and 3 SEIR : crash

Selecting either QSS1 QSS2 or QSS3 SEIR model crashes irrotator after one left mouse click in the editor window.
In the three cases, a QSS2 power model is visible.

is_directory in procedures raises an error when touching system or special files (Windows)

Hi
sort and other file dialog functions use the is_directory function which raises an error when touching pagefile.sys, hiberfil.sys...
Therefore disk C:\ cannot be a starting point for exploration in file select dialog (windows version).
I fixed it with a special sort fonction (9 cases instead of 4) but total fixing needs a modification of all the dialog functions which call is_directory.

The sort function in dialog-file.cpp becomes :

void sort() // Nedelec
{
    std::sort(std::begin(paths),
              std::end(paths),
              [](const auto& lhs, const auto& rhs) {
                  std::string slhs = lhs.filename().string();
                  std::string srhs = rhs.filename().string();
                  if (slhs.find(".sys") == -1) {
                      if (std::filesystem::is_directory(lhs)) {
                          if (srhs.find(".sys") == -1) {
                              if (std::filesystem::is_directory(rhs))
                                  return lhs.filename() < rhs.filename();
                              else
                                  return true;
                          } else {
                              return true;
                          }
                      } else {
                          if (srhs.find(".sys") == -1) {
                              if (std::filesystem::is_directory(rhs))
                                  return false;
                              else
                                  return lhs.filename() < rhs.filename();
                          } else {
                              return lhs.filename() < rhs.filename();
                          }
                      }
                  } else {
                      if (srhs.find(".sys") == -1) {
                          if (std::filesystem::is_directory(rhs))
                              return false;
                          else
                              return lhs.filename() < rhs.filename();
                      } else {
                          return lhs.filename() < rhs.filename();
                      }
                  }

    });
}

I didn't find a solution to avoid this error, maybe a function different from is_directory, or a modified one...

Frequent death of application when clearing the simulation editor panel (Windows)

Hi
After a long pause in Using Irritator I came back to the latest version and installed it on windows quite easily and successfully.
However an assert instruction frequently kills the application when clearing (by clicking on "Clear" button) the simulation editor panel.

The line responsible for this is the commented one in :

template<typename Dynamics>
static void add_output_attribute(simulation_editor& ed,
                                 const Dynamics&    dyn) noexcept
{
    if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
        const auto** names  = get_output_port_names<Dynamics>();
        const auto&  mdl    = get_model(dyn);
        const auto   mdl_id = ed.sim.models.get_id(mdl);

        sz i = 0;
        for ([[maybe_unused]] auto& elem : dyn.y) {
            irt_assert(i < 8u);

            //assert(ed.sim.models.try_to_get(mdl_id) == &mdl); //xxx Nedelec

            ImNodes::BeginOutputAttribute(make_output_node_id(mdl_id, (int)i),
                                          ImNodesPinShape_TriangleFilled);
            ImGui::TextUnformatted(names[i]);
            ImNodes::EndOutputAttribute();
            ++i;
        }
    }
}

[simulation-editor.cpp]

I couldn't identify a reason for these fatal errors nor any faulty order in instructions prior to its happening, it occurs after a while but sometimes quickly, sometimes after a few successful imports.
I commented the instruction but I guess it's not a good idea.

It does not change the simulation quality so i just report the situation.

Have a nice summer
Yves

Crash when setting parameter value

Irritator crashes when I tried to change the "reset" parameter for a QSS2 integrator in the modelling tab.
Hereafter the gdb bt;
#0 0x00007ffff7a46a7c in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff79f2476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff79d87f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff79d871b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff79e9e96 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x0000555555b835ba in ImGui::GetKeyData(int) ()
#6 0x0000555555b838ba in ImGui::IsKeyReleased(int) ()
#7 0x0000555555aa3410 in irt::show_modeling_widget(irt::settings_manager const&, irt::component_editor&, irt::tree_node&, irt::component&) ()
#8 0x0000555555aa3678 in irt::application::show_modeling_editor_widget() ()
#9 0x0000555555571328 in irt::application::show_main_as_tabbar(ImVec2, ImVec2, int, int, int) ()
#10 0x0000555555570e1a in irt::application_show_windows(irt::application&) ()
#11 0x0000555555571013 in irt::application::show() ()
#12 0x0000555555c2fce5 in main ()

-Wformat warning: node-editor

warning: format specifies type 'unsigned long long' but the argument has type 'irt::cluster*'
[-Wformat] log_w.log(7, "delete group %" PRIu64 "\n", gp);

refactor is-compatible ports with constexpr

We known the type of output/input for each ports. So we can provide a constant
expression is-compatible port for each model.

enum class value_port_type : i8 {
	continuous,
	discrete,
	both
};

class counter {
	input_port x[1];

	constexpr value_port_type x_type(int i) noexcept
	{
		return value_port_type::both;
	}

};

class abstract_cross{
	input_port x[4];
	output_port y[3];

	constexpr value_port_type x_type(int i) noexcept
	{
		return value_port_type::both;
	}

	constexpr value_port_type y_type(int i) noexcept
	{
		if (i == 0 || i == 1)
			return value_port_type::continuous;
		else
			return value_port_type::discrete;
	}
};

Save atomic model's name

Currently, atomic model names are numbers. Would be better when givong a name to a model, irritator saves it in the irt files.

component-list and observation layout problem

In menu View, Fix window layout disable, Merge main editors disable, the
Components list and Observation flick when simulation or modeling
editors are selected.

May be use ImGui::TabBar and multiple windows.

Irritator crashes when opening a .irt file.

I built a SIR epidemiological model using the graphical interface. Everything looked good, I could simulate my model. I decided to save what I have done in a .irt file. I quit irritator and then try to reopen my file, but it crashed. I opened my .irt file to change the names of my models, suspecting that models with the same names (automatically generated by the GUI) could be the origin of the crash. Unfortunately changing the names does not fix the problem.
Hereafter are the two files I tried to open.
--------
File 2:
--------

8
0 qss2_i qss2_integrator 0.9 0.0001
1 qss2_m qss2_multiplier
2 qss2_i qss2_integrator 0.1 0.0001
3 qss2_w qss2_wsum_2 -0.1 0
4 qss2_w qss2_wsum_2 0.1 0
5 qss2_i qss2_integrator 0 0.0001
6 qss2_w qss2_wsum_2 -0.01 1
7 qss2_w qss2_wsum_2 0.01 0
0 0 3 1
0 0 1 1
1 0 4 0
1 0 3 0
2 0 7 0
2 0 6 0
2 0 4 1
2 0 1 0
3 0 0 0
4 0 6 1
5 0 7 1
6 0 2 0
7 0 5 0

--------
File 2:
--------

8
0 Suceptible qss2_integrator 0.9 0.0001
1 S_multi qss2_multiplier
2 Infectious qss2_integrator 0.1 0.0001
3 I_sum_1 qss2_wsum_2 -0.1 0
4 I_sum_2 qss2_wsum_2 0.1 0
5 Recovered qss2_integrator 0 0.0001
6 R_sum_1 qss2_wsum_2 -0.01 1
7 R_Sum_2 qss2_wsum_2 0.01 0
0 0 3 1
0 0 1 1
1 0 4 0
1 0 3 0
2 0 7 0
2 0 6 0
2 0 4 1
2 0 1 0
3 0 0 0
4 0 6 1
5 0 7 1
6 0 2 0
7 0 5 0

End of output files may come too early

Hi,
with the following irt file :

4
0 qss1_integrator 0 0.01
1 qss1_integrator 1 0.01
2 qss1_multiplier
3 constant -1
0 0 1 0
1 0 2 0
2 0 0 0
3 0 2 1

and a simulation duration of 40.
output files end with incomplete data (observed value is missing, sometimes there is just ",-" as second data) :

39.39542200587955,-0.12
39.403486522008585,-0.13
39.41155103813762,-0.14
39.41961555426665,-0.15
39.42768007

and

39.322841360718265,-1.2478225
39.3309058768473,-1.2475806
39.33897039297633,-1.2472581
39.34703490910536,-1.2468548
39.35509942523439,-1.2463709
39.363163941363

when run should end at 40.0

  1. dat and 1.dat read as follow when both value are 0.001 :

39.99365467195294,-0.76860154
39.994954484185236,-0.7678392
39.99625576205632,-0.76707226
39.99755851445617,-0.7663007
39.998862750304426,-0.76552445
39.99998064193025,-0.7642376

and

39.994954484185236,-0.6796578
39.99625576205632,-0.6805243
39.99755851445617,-0.6813941
39.998862750304426,-0.68226725
39.99998064193025,-0.68371147

Add more behaviour to constant model.

To simplify grid/graph component development (avoid duplicated component) we
can improve the contant model. Instead of user real value assignation at
begin of the simulation or at the construction of the model, we can provide
more general value.

For example, at modeling level, a pair of real:

  • constant value + offset time
  • number of connected input or output port + offset time
  • number of connection on a port + offset time

At simulation level, only:

  • constant value + offset time

This feature need a new algorithm in modeling-to-simulation algorithm
(project::set).

Saving positions of model in the editor window.

Position of models in the editor window are not saved when clicking on "file->save" in the editor menu. They are correctly saved clicking on "menu->save as..." and using a new file name.

fix cmake warnings

Need to remove this warnings about unused variables. Maybe define C variable to
improve code?

CMake Warning:
   Manually-specified variables were not used by the project:
   CMAKE_C_COMPILER
   WITH_FULL_OPTIMIZATION

Writing in file output occurs only at first run

Hi,
I'm testing a simple model d2x/dt2 - x = 0 which produces sin and cos output.
irt file :

4
0 qss1_integrator 0 0.001
1 qss1_integrator 1 0.001
2 qss1_multiplier
3 constant -1
0 0 1 0
1 0 2 0
2 0 0 0
3 0 2 1

When a file output is selected for both integrators the files are written only at first run. It is necessary to select something else (None or plot) and then select back file to get updated files after a new run (in my case following a change in reset value).

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.