Below is the main body instruction and modifiable code provided to me for my project assignment that does not execute properly in gradescope. There are a few other .py files in the assignment folder titled "problemset", "problem", "grader" etc that we were instructed not to touch.
I currently believe there's some issue with my code regarding how values are passed into the solve method that I've bolded.
My current code passes "image_path" as defined below to pass into the solve method:
image_path = os.path.join('Basic Problems B', 'Basic Problem B-02', 'Basic Problem B-02.png')
However this is incorrect and I'm having difficulty understanding my TA's email feedback which is below:
"I think your issue is how you are trying to access the problem names and are overcomplicating the process. You shouldn't be trying to construct the problem names yourself as these are shuffled and randomized in the gradescope environment. Everything you need is passed into the Agent solve method. Using problem.figures["A"].visualFilename is all that is required to get the image A.png file from the dictionary supplied to the agent. Please try this approach to see if that simples the processing by the agent."
class Agent:
def __init__(self):
self.a = ""
"""
The default constructor for your Agent. Make sure to execute any processing necessary before your Agent starts
solving problems here. Do not add any variables to this signature; they will not be used by main().
"""
pass
**def Solve(self, problem):**
"""
Primary method for solving incoming Raven's Progressive Matrices.
Args:
problem: The problem instance.
Returns:
int: The answer (1 to 6). Return a negative number to skip a problem.
Remember to return the answer [Key], not the name, as the ANSWERS ARE SHUFFLED.
DO NOT use absolute file pathing to open files.
"""
# Example: Preprocess the 'A' figure from the problem.
# Actual solution logic needs to be implemented.
#image_a = self.preprocess_image(problem.figures["A"].visualFilename)
# Placeholder: Skip all problems for now.
return -1
Any suggestions/ideas as to what the issue is and how I can resolve it? Much appreciated.
I've tried changing my working directories, but I'm not really sure what other levers I have to adjust.