Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds negative utilitarianism #50

Closed
wants to merge 0 commits into from

Conversation

hadiyachishti
Copy link

No description provided.

Copy link
Contributor

@colinhanrahan colinhanrahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review—I left these comments a while ago but apparently when they're "Pending" they're only visible to me.

ethics.py Outdated
@@ -35,8 +40,8 @@ def findEthicalValueOfCell(self, cell):
futureDuration = futureDuration / cellMaxSiteWealth if cellMaxSiteWealth > 0 else 0
futureIntensity = cellNeighborWealth / (globalMaxWealth * 4)
# Assuming agent can only see in four cardinal directions
extent = neighborhoodSize / (neighbor.vision * 4) if neighbor.vision > 0 else 1
futureExtent = futureNeighborhoodSize / (neighbor.vision * 4) if neighbor.vision > 0 and self.lookahead != None else 1
extent = len(self.neighborhood) / (neighbor.vision * 4) if neighbor.vision > 0 else 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current and future neighborhood sizes are calculated outside the loop because calculating them inside the loop doubles overall simulation runtime (#38). I recommend keeping this outside of the loop as is currently implemented.

agent.py Outdated
@@ -617,14 +619,9 @@ def findBestEthicalCell(self, cells, greedyBestCell=None):
# If not an ethical agent, return top selfish choice
if self.decisionModel == "none":
return greedyBestCell

for cell in cells:
ethicalScore = self.findEthicalValueOfCell(cell["cell"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the logic for finding the best ethical cell calling self.findEthicalValueOfCell() has been removed here, maybe for testing?

agent.py Outdated
@@ -607,6 +607,8 @@ def findBestCell(self):
print("Agent {0} moving to ({1},{2})".format(self.ID, bestCell.x, bestCell.y))
return bestCell



Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extra whitespace can be removed.

@colinhanrahan
Copy link
Contributor

Hey @hadiyachishti, I noticed that you're adding a lot of files to the commit and then removing them. If you only want to add tracked files (the code you're changing), you can use git add -u or run git status to see what you changed and then git add <file> one by one. I use git status all the time to make sure I'm staging the correct files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants