-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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"]) |
There was a problem hiding this comment.
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 | |||
|
|||
|
|||
|
There was a problem hiding this comment.
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.
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 |
No description provided.