def parallel(self): """ :rtype : list[Component] """ parallel_comps = [] for comp in self.pos.connected_comps: if helper_funcs.other_node(comp, self.pos) == self.neg: parallel_comps.append(comp) for comp in self.neg.connected_comps: if helper_funcs.other_node(comp, self.neg) == self.pos: parallel_comps.append(comp) return parallel_comps
def step_down_branch(self): for comp in self.branch.component_list: if ((self.location in comp.nodes) and (comp not in self.components_seen)): component_to_jump_over = comp break destination = helper_funcs.other_node(component_to_jump_over, self.location) return self.step_to(destination)
def step_down_unseen_vsource(self): """ Steps down the first unseen voltage source in the list :return: returns the list of components that was stepped over """ self.breadcrumbs.append(self.location) return self.step_to(helper_funcs.other_node(self.unseen_vsources_connected()[0], self.location))
def new_directions(self): """ Returns a list containing the directions (nodes) that the cursor can go but has not been to yet :rtype: list[Node] """ new_direcs = [] for comp in self.location.connected_comps: if comp in self.components_seen: continue else: new_direcs.append(helper_funcs.other_node(comp, self.location)) return new_direcs
def directions(self): """ Returns a list containing the directions (nodes) the cursor can go :rtype: list[Node] """ return [helper_funcs.other_node(comp, self.location) for comp in self.location.connected_comps]
def step_down_unseen_comp(self): self.breadcrumbs.append(self.location) return self.step_to(helper_funcs.other_node(self.unseen_connected()[0], self.location))