numerical_simulation.plt 689 Bytes
Newer Older
1 2 3 4 5
:- use_module(library(plunit)).

:- begin_tests(numerical_simulation).


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

MARTINEZ Thierry 's avatar
MARTINEZ Thierry committed
11 12 13
test('events') :-
  clear_model,
  command('MA'(k) for a => b),
14
  command(parameter(k = 1)),
MARTINEZ Thierry 's avatar
MARTINEZ Thierry committed
15
  command(add_event(b > 0.5, k = 0)),
SOLIMAN Sylvain's avatar
SOLIMAN Sylvain committed
16
  command(add_event('Time' > 1, k = 0)),
MARTINEZ Thierry 's avatar
MARTINEZ Thierry committed
17
  command(present(a)),
SOLIMAN Sylvain's avatar
SOLIMAN Sylvain committed
18
  command(numerical_simulation(time: 2)).
19

20 21 22 23
test('conditional') :-
  clear_model,
  command(if a < 0.5 then 'MA'(2) else 'MA'(1) for a => b),
  command(present(a)),
24
  command(numerical_simulation(initial_step_size:0.001)).
25

26
:- end_tests(numerical_simulation).