def test_Sub_to_Turbine_assembly_interaction(env, sub_lines, turb_lines): num_turbines = 50 assigned = [1] * num_turbines feed = WetStorage(env, capacity=2) target = WetStorage(env, capacity=float("inf")) for a in range(sub_lines): assembly = SubstructureAssemblyLine(assigned, 10, feed, a + 1) env.register(assembly) assembly.start() for a in range(turb_lines): assembly = TurbineAssemblyLine(feed, target, {"tower": { "sections": 1 }}, a + 1) env.register(assembly) assembly.start() env.run() df = pd.DataFrame(env.actions) assert len(df.loc[df["action"] == "Mechanical Completion"]) == num_turbines
def initialize_turbine_assembly(self): """ Initializes turbine assembly lines. The number of independent lines can be configured with the following parameters: - self.config["port"]["turb_assembly_lines"] """ try: storage = self.config["port"]["assembly_storage"] except KeyError: storage = float("inf") self.assembly_storage = WetStorage(self.env, storage) try: lines = self.config["port"]["turbine_assembly_cranes"] except KeyError: lines = 1 turbine = self.config["turbine"] self.turbine_assembly_lines = [] for i in range(lines): a = TurbineAssemblyLine(self.wet_storage, self.assembly_storage, turbine, i + 1) self.env.register(a) a.start() self.turbine_assembly_lines.append(a)
def test_TurbineAssemblyLine(env, num, assigned): _assigned = len(assigned) feed = WetStorage(env, capacity=float("inf")) target = WetStorage(env, capacity=float("inf")) for i in assigned: feed.put(0) for a in range(num): assembly = TurbineAssemblyLine(feed, target, {"tower": {"sections": 1}}, a + 1) env.register(assembly) assembly.start() env.run() df = pd.DataFrame(env.actions) assert len(df.loc[df["action"] == "Mechanical Completion"]) == len(assigned)
def test_SubstructureAssemblyLine(env, num, assigned, expected): _assigned = len(assigned) storage = WetStorage(env, capacity=float("inf")) for a in range(num): assembly = SubstructureAssemblyLine(assigned, 10, storage, a + 1) env.register(assembly) assembly.start() env.run() assert len(env.actions) == _assigned assert env.now == expected
def initialize_substructure_production(self): """ Initializes the production of substructures at port. The number of independent assembly lines and production time associated with a substructure can be configured with the following parameters: - self.config["substructure"]["takt_time"] - self.config["port"]["sub_assembly_lines"] """ try: storage = self.config["port"]["sub_storage"] except KeyError: storage = float("inf") self.wet_storage = WetStorage(self.env, storage) try: time = self.config["substructure"]["takt_time"] except KeyError: time = 0 try: lines = self.config["port"]["sub_assembly_lines"] except KeyError: lines = 1 num = self.config["plant"]["num_turbines"] to_assemble = [1] * num self.sub_assembly_lines = [] for i in range(lines): a = SubstructureAssemblyLine(to_assemble, time, self.wet_storage, i + 1) self.env.register(a) a.start() self.sub_assembly_lines.append(a)