Skip to content

Commit

Permalink
Merge pull request #7 from UtkarshKunwar/features/security_guard
Browse files Browse the repository at this point in the history
Security guard won't chase bad guys who were bored and left themselves.
  • Loading branch information
UtkarshKunwar authored Dec 20, 2019
2 parents 39dc44d + 3982b69 commit 2d6a51a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion models/base.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,15 @@ species SecurityGuard skills: [moving, fipa] {
do start_conversation with: [to::list(InformationCentre), protocol::'fipa-contract-net', performative::'inform', contents::['Removed', removed_agent]];
}

//Do not continue hunt when bad agent die out itself
reflex discontinueHunt when: hunting and dead(bad_agent) {
write "Cycle (" + string(cycle) + ") Agent (" + "bad agent killed himself.";
targetPoint <- securityGuardPoint;
eliminated <- true;
hunting <- false;
reached_bad_agent <- false;
}

// Hunts bad people one by one
reflex getTarget when: length(badPeoples) > 0 and !hunting {
if !dead(badPeoples[0]) {
Expand Down Expand Up @@ -1734,7 +1743,7 @@ experiment festival type: gui {
species Stage aspect: icon;
}

inspect "journalist inspector" value: Journalist attributes: ["interviewed_count", "moving", "interviewing", "curious"];
//inspect "journalist inspector" value: Journalist attributes: ["interviewed_count", "moving", "interviewing", "curious"];
//inspect "guest" value: FestivalGuest attributes: ["bored"] type: table;
//inspect "evil guest" value: EvilGuest attributes: ["bored", "bad"] type: table;
//inspect "guard" value: SecurityGuard attributes: ["wallet", "isCorrupt", "isStrict"] type: table;
Expand Down

0 comments on commit 2d6a51a

Please sign in to comment.