add missing scripts
This commit is contained in:
parent
b7e9245f26
commit
d22b5a97fd
33
packages/CLPBN/clpbn/bp/benchmarks/city/gen_city.sh
Executable file
33
packages/CLPBN/clpbn/bp/benchmarks/city/gen_city.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#! /home/tgomes/bin/yap -L --
|
||||||
|
|
||||||
|
|
||||||
|
:- initialization(main).
|
||||||
|
|
||||||
|
|
||||||
|
main :-
|
||||||
|
unix(argv([N])),
|
||||||
|
atomic_concat(['city', N, '.yap'], FileName),
|
||||||
|
open(FileName, 'write', S),
|
||||||
|
atom_number(N, N2),
|
||||||
|
generate_people(S, N2, 1),
|
||||||
|
write(S, '\n'),
|
||||||
|
generate_evidence(S, N2, 1),
|
||||||
|
write(S, '\n'),
|
||||||
|
close(S).
|
||||||
|
|
||||||
|
|
||||||
|
generate_people(S, N, Counting) :-
|
||||||
|
Counting > N, !.
|
||||||
|
generate_people(S, N, Counting) :-
|
||||||
|
format(S, 'people(p~w, nyc).~n', [Counting]),
|
||||||
|
Counting1 is Counting + 1,
|
||||||
|
generate_people(S, N, Counting1).
|
||||||
|
|
||||||
|
|
||||||
|
generate_evidence(S, N, Counting) :-
|
||||||
|
Counting > N, !.
|
||||||
|
generate_evidence(S, N, Counting) :- !,
|
||||||
|
format(S, 'ev(descn(p~w, t)).~n', [Counting]),
|
||||||
|
Counting1 is Counting + 1,
|
||||||
|
generate_evidence(S, N, Counting1).
|
||||||
|
|
23
packages/CLPBN/clpbn/bp/benchmarks/workshop_attrs/gen_people.sh
Executable file
23
packages/CLPBN/clpbn/bp/benchmarks/workshop_attrs/gen_people.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/home/tgomes/bin/yap -L --
|
||||||
|
|
||||||
|
|
||||||
|
:- initialization(main).
|
||||||
|
|
||||||
|
|
||||||
|
main :-
|
||||||
|
unix(argv([N])),
|
||||||
|
atomic_concat(['pop', N, '.yap'], FileName),
|
||||||
|
open(FileName, 'write', S),
|
||||||
|
atom_number(N, N2),
|
||||||
|
generate_people(S, N2, 4),
|
||||||
|
write(S, '\n'),
|
||||||
|
close(S).
|
||||||
|
|
||||||
|
|
||||||
|
generate_people(S, N, Counting) :-
|
||||||
|
Counting > N, !.
|
||||||
|
generate_people(S, N, Counting) :-
|
||||||
|
format(S, 'people(p~w).~n', [Counting]),
|
||||||
|
Counting1 is Counting + 1,
|
||||||
|
generate_people(S, N, Counting1).
|
||||||
|
|
Reference in New Issue
Block a user