Skip to content

Added more assessment rules designed for individual graphs #4009

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

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 184 additions & 0 deletions econplayground/main/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,56 @@ def get_rule_options(cls) -> dict:
class Graph9(BaseGraph):
graph_type = 9

@classmethod
def get_rule_options(cls) -> dict:
rules = super().get_rule_options()
rules.update({
'area_a_name': 'A',
'area_b_name': 'B',
'area_c_name': 'C',
})


class Graph10(BaseGraph):
graph_type = 10

@classmethod
def get_rule_options(cls) -> dict:
return {
'line1': {
'name': 'Orange line',
'possible_values': cls.line_actions,
},

'line2': {
'name': 'Blue line',
'possible_values': cls.line_actions,
},

'line1 label': 'Orange line label',
'line2 label': 'Blue line label',
'intersectionLabel': 'Intersection label',
'intersectionHorizLineLabel':
'Orange-Blue intersection horizontal label',
'intersectionVertLineLabel':
'Orange-Blue intersection vertical label',
'area_a_name': 'A',
'area_b_name': 'B',
'area_c_name': 'C',
'a1': {
'name': 'A',
'possible_values': cls.variable_actions,
},
'a2': {
'name': 'K',
'possible_values': cls.variable_actions,
},
'a3': {
'name': 'N',
'possible_values': cls.variable_actions,
},
}


class Graph11(BaseGraph):
graph_type = 11
Expand Down Expand Up @@ -252,14 +298,106 @@ def get_rule_options(cls) -> dict:
class Graph12(BaseGraph):
graph_type = 12

@classmethod
def get_rule_options(cls) -> dict:
return {
'line1': {
'name': 'Orange line',
'possible_values': cls.line_actions,
},

'line2': {
'name': 'Blue line',
'possible_values': cls.line_actions,
},

'line1 label': 'Orange line label',
'line2 label': 'Blue line label',
'intersectionLabel': 'Intersection label',
'intersectionHorizLineLabel':
'Orange-Blue intersection horizontal label',
'intersectionVertLineLabel':
'Orange-Blue intersection vertical label',
'a1': {
'name': 'A',
'possible_values': cls.variable_actions,
},
'a2': {
'name': 'K',
'possible_values': cls.variable_actions,
},
'a3': {
'name': 'N',
'possible_values': cls.variable_actions,
},
}


class Graph13(BaseGraph):
graph_type = 13

@classmethod
def get_rule_options(cls) -> dict:
rules = super().get_rule_options()
rules.update({
'line3': {
'name': 'Right Graph: Orange line',
'possible_values': cls.line_actions,
},

'line4': {
'name': 'Right Graph: Blue line',
'possible_values': cls.line_actions,
},
'line3 label': 'Orange line label',
'line4 label': 'Blue line label',
'intersection2Label': 'Intersection label',
'intersection2HorizLineLabel':
'Orange-Blue intersection horizontal label',
'intersection2VertLineLabel':
'Orange-Blue intersection vertical label',
'x-axis-2 label': 'X-axis label',
'y-axis-2 label': 'Y-axis label',
})


class Graph14(BaseGraph):
graph_type = 14

@classmethod
def get_rule_options(cls) -> dict:
return {
'line1': {
'name': 'Orange line',
'possible_values': cls.line_actions,
},

'line2': {
'name': 'Blue line',
'possible_values': cls.line_actions,
},

'line1 label': 'Orange line label',
'line2 label': 'Blue line label',
'intersectionLabel': 'Intersection label',
'intersectionHorizLineLabel':
'Orange-Blue intersection horizontal label',
'intersectionVertLineLabel':
'Orange-Blue intersection vertical label',
'a1': {
'name': 'A',
'possible_values': cls.variable_actions,
},
'a2': {
'name': 'K',
'possible_values': cls.variable_actions,
},
'a3': {
'name': 'N',
'possible_values': cls.variable_actions,
},
}


class Graph16(BaseGraph):
graph_type = 16
Expand Down Expand Up @@ -334,6 +472,27 @@ def get_rule_options(cls) -> dict:
class Graph22(BaseGraph):
graph_type = 22

@classmethod
def get_rule_options(cls) -> dict:
return {
'a1': {
'name': 'Choke Price',
'possible_values': cls.variable_actions,
},
'a2': {
'name': 'Demand Slope',
'possible_values': cls.variable_actions,
},
'a3': {
'name': 'Reservation Price',
'possible_values': cls.variable_actions,
},
'a4': {
'name': 'Supply Slope',
'possible_values': cls.variable_actions,
},
}


class Graph23(BaseGraph):
graph_type = 23
Expand Down Expand Up @@ -367,6 +526,31 @@ def get_rule_options(cls) -> dict:
class Graph24(BaseGraph):
graph_type = 24

@classmethod
def get_rule_options(cls) -> dict:
return {
'a1': {
'name': 'Choke Price',
'possible_values': cls.variable_actions,
},
'a2': {
'name': 'Demand Slope',
'possible_values': cls.variable_actions,
},
'a3': {
'name': 'Reservation Price',
'possible_values': cls.variable_actions,
},
'a4': {
'name': 'Supply Slope',
'possible_values': cls.variable_actions,
},
'a5': {
'name': 'Unit Tax',
'possible_values': cls.variable_actions,
},
}


class Graph25(BaseGraph):
graph_type = 25
Expand Down