numerical_simulation.plt 594 Bytes
Newer Older
Thierry Martinez's avatar
Thierry Martinez committed
1 2 3 4 5
:- use_module(library(plunit)).

:- begin_tests(numerical_simulation).


6
test('mapk', [condition(flag(slow_test, true, true))]) :-
Thierry Martinez's avatar
Thierry Martinez committed
7
  clear_model,
Thierry Martinez's avatar
Thierry Martinez committed
8
  command(load(library:examples/mapk/mapk)),
9
  numerical_simulation(100).
Thierry Martinez's avatar
Thierry Martinez committed
10

Thierry Martinez's avatar
Thierry Martinez committed
11 12 13 14 15 16 17
test('events') :-
  clear_model,
  command('MA'(k) for a => b),
  command(set_parameter(k = 1)),
  command(add_event(b > 0.5, k = 0)),
  command(present(a)),
  numerical_simulation(20).
Thierry Martinez's avatar
Thierry Martinez committed
18

Thierry Martinez's avatar
Thierry Martinez committed
19 20 21 22 23 24
test('conditional') :-
  clear_model,
  command(if a < 0.5 then 'MA'(2) else 'MA'(1) for a => b),
  command(present(a)),
  numerical_simulation(20).

Thierry Martinez's avatar
Thierry Martinez committed
25
:- end_tests(numerical_simulation).