Skip to content

Commit

Permalink
update loanIfNotEnough in MAS-C example
Browse files Browse the repository at this point in the history
  • Loading branch information
mauris committed Aug 27, 2018
1 parent 9625ee2 commit 930b7cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/mas/c/agent.lps
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processId(Agent), wantToBuy(Agent, Item, T1, T2) ->
itemPrice(Item, Price),
money(Agent, Amount, T3),
loanIfNotEnough(Agent, Price, Amount, T3, T4),
loanIfNotEnough(Agent, Price, Amount) from T3 to T4,
buy(Agent, Item, T4, T5).

processId(Self), borrow(Borrower, Self, Amount, T1, T2) ->
Expand Down
4 changes: 2 additions & 2 deletions examples/mas/c/main.lps
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ observe(wantToBuy(alice, cereal), 3, 4).
%% ---------------------
% This section would be better modelled in the agent file
% but because of the duplication issues, i'm leaving it here for now.
loanIfNotEnough(Agent, Price, Amount, T, T) <-
loanIfNotEnough(Agent, Price, Amount) from T1 to T2 <-
Price <= Amount.

loanIfNotEnough(Agent, Price, Amount, T1, T2) <-
loanIfNotEnough(Agent, Price, Amount) from T1 to T2 <-
Price > Amount,
consult(_, Peer),
% Peer != Agent,
Expand Down

0 comments on commit 930b7cf

Please sign in to comment.