Category : modeling

How to fix? import json def get_line_list(c, e, s): l = [] for i in range(c): l.append(CashierLine()) for i in range(e): l.append(ExpressLine()) for i in range(s): l.append(SelfServeLine()) return l class GroceryStore: def __init__(self, filename): with open(filename, ‘r’) as file: config = json.load(file) self._line_capacity = config[‘line_capacity’] self._express_count = config[‘express_count’] self._cashier_count = config[‘cashier_count’] self._self_serve_count = config[‘self_serve_count’] self._lines ..

Read more

What is the best OOP way to model the following?: There is a set of objects that inherit from class Configurable, and a tree of Configurations/sub-configurations. Conceptually, each Configuration object represents the state of all the Configurables, and configurations inherit (and can override) settings from their parents. At any given time, one of the Configurations ..

Read more

I explain briefly what the attached program code should do. We give a number of passes before runs = 100. and we give I = 10. For example we set the area_factor = 1. Then the function HH_model(I,area_factor) does the following: run 100 times with this I and this area_factor and return the number of ..

Read more

Suppose we consider a function test(x,y) that returns a number of events depending on the input parameters x and y (we call the number of events ‘triggers’). now I would like to do the following: find parameter x,y so that the following holds for y=number1 trigger = run/2 for y = number1*0.95 triggers = run/3 ..

Read more