Skip to content
Snippets Groups Projects
Commit 7b56e5d1 authored by Eric Würbel's avatar Eric Würbel
Browse files

forgotten save

parent 951b49f4
Branches
Tags
No related merge requests found
...@@ -430,21 +430,24 @@ build_prio_bel_assoc2(InA, Ni/Bi, [Si/_|Strata], OutA) :- ...@@ -430,21 +430,24 @@ build_prio_bel_assoc2(InA, Ni/Bi, [Si/_|Strata], OutA) :-
build_prio_bel_assoc2(A1, Ni/Bi, Strata, OutA). build_prio_bel_assoc2(A1, Ni/Bi, Strata, OutA).
beliefs_prio1([], A, A). beliefs_prio1([], A, A, _).
beliefs_prio1([(Label, _, Mass)|GBBA], InA, OutA) :- beliefs_prio1([(Label, _, Mass)|GBBA], InA, OutA, Opts) :-
last(Label, s(S)), % last elem of label is a strata last(Label, s(S)), % last elem of label is a strata
select(s(S), Label, Label1), % Label1 is Label without stratum select(s(S), Label, Label1), % Label1 is Label without stratum
update_bel(S, Label1, Mass, InA, A1), update_bel(S, Label1, Mass, InA, A1, Opts),
beliefs_prio1(GBBA, A1, OutA). beliefs_prio1(GBBA, A1, OutA, Opts).
beliefs_prio1([_|GBBA], InA, OutA) :- beliefs_prio1([_|GBBA], InA, OutA, Opts) :-
beliefs_prio1(GBBA, InA, OutA). beliefs_prio1(GBBA, InA, OutA, Opts).
update_bel(_, [], _, A, A). update_bel(_, [], _, A, A, _).
update_bel(S, [b(I)|Label], Mass, InA, OutA) :- update_bel(S, [b(I)|Label], Mass, InA, OutA, Opts) :-
get_assoc([b(I), s(S)], InA, (Bi, BValue)), get_assoc([b(I), s(S)], InA, (Bi, BValue)),
NewB is BValue + Mass, ( memberchk(lambda(true), Opts)
-> NewB #= BValue + Mass
; NewB is BValue + Mass
),
put_assoc([b(I), s(S)], InA, (Bi, NewB), A1), put_assoc([b(I), s(S)], InA, (Bi, NewB), A1),
update_bel(S, Label, Mass, A1, OutA). update_bel(S, Label, Mass, A1, OutA, Opts).
assoc_to_prio_bel(Assoc, Bels) :- assoc_to_prio_bel(Assoc, Bels) :-
assoc_to_list(Assoc, BList), assoc_to_list(Assoc, BList),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment