It's UWAweek 51

help3011

This forum is provided to promote discussion amongst students enrolled in CITS3011 Intelligent Agents.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 2 articles in this topic
Showing 2 of 83 articles.
Currently 16 other people reading this forum.


 UWA week 42 (2nd semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
3:11pm Tue 15th Oct, ANONYMOUS

I believe there might be an issue with vote_outcome(), def vote_outcome(self, mission, proposer, votes): ''' mission is a list of agents to be sent on a mission. The agents on the mission are distinct and indexed between 0 and number_of_players. proposer is an int between 0 and number_of_players and is the index of the player who proposed the mission. votes is a dictionary mapping player indexes to Booleans (True if they voted for the mission, False otherwise). No return value is required or expected. ''' Here it says votes is a dictionary, however this is not true, it appears that it is just a list with the playernumbers who voted yes. Is it ok to consider it as a list?


SVG not supported

Login to reply

👍?
helpful
11:02am Wed 16th Oct, Andrew G.

ANONYMOUS wrote:

I believe there might be an issue with vote_outcome(),

def vote_outcome(self, mission, proposer, votes):
    '''
    mission is a list of agents to be sent on a mission. 
    The agents on the mission are distinct and indexed between 0 and number_of_players.
    proposer is an int between 0 and number_of_players and is the index of the player who proposed the mission.
    votes is a dictionary mapping player indexes to Booleans (True if they voted for the mission, False otherwise).
    No return value is required or expected.
    '''

Here it says votes is a dictionary, however this is not true, it appears that it is just a list with the playernumbers who voted yes. Is it ok to consider it as a list?

Good catch. Yes it seems that the person(s) who developed this code changed their mind at some point and forgot to change the documentation. This is why we provide testing code, however, so that you are able to make sure your agent actually works with the interface provided. Go with what the code actually does rather than what the (out of date) documentation says. If you are feeling paranoid, you could write your function so that it works for either format, for example by converting the dict format into a list if it is one:

def vote_outcome(self, mission, proposer, votes):
    if type(votes) is dict:
        votes = list(i for i, v in votes.items() if v)
    ...

You should be fine to just assume it is a list though. If your code functions correctly with the test code we have provided, it should function correctly when being assessed. The intent is to assess agent performance, not whether your agent implements the interface correctly (that is just a necessary part of being able to assess performance).

Cheers, Gozz

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy