def __init__(self, obj, connection, subsystem_from, subsystem_to): Coupling.__init__(self, obj, connection, subsystem_from, subsystem_to) obj.addProperty("App::PropertyFloat", "Area", "Surface", "Area of the connecting surface.") obj.setEditorMode("Area", 1) obj.addProperty("App::PropertyFloat", "CriticalFrequency", "Coupling", "Critical frequency.") obj.setEditorMode("CriticalFrequency", 1) obj.addProperty("App::PropertyFloatList", "RadiationEfficiency", "Coupling", "Radiation effiency.") obj.setEditorMode("RadiationEfficiency", 1) self.calc_area(obj)
def execute(self, obj): Coupling.execute(self, obj)
def onChanged(self, obj, prop): Coupling.onChanged(self, obj, prop)
def __init__(self, obj, connection, subsystem_from, subsystem_to): Coupling.__init__(self, obj, connection, subsystem_from, subsystem_to)
def add_coupling(self, source_port, source, target_port, target): # Both input and output ports are appended to the coupling list self.coupling_list.append( Coupling(source_port, source, target_port, target))
def execute(self, obj): Coupling.execute(self, obj) self.calc_area(obj)
def onChanged(self, obj, prop): Coupling.onChanged(self, obj, prop) if prop == 'Area': obj.Proxy.area = obj.Area
# Step 1: Extract Model from Stability import Stability fact_extractor = FactExtractor("Test_Classes/") # fact_extractor = FactExtractor("source_files/") model = fact_extractor.make_model() # Step 2: Classify # Test step for fitness calculation ipc = 0 rfc = 0 tcc = 0 ich = 0 lcom5 = 0 wmc = 0 nom = 0 instability = 0 for c in model: rfc += Coupling.get_RFC(c) ipc += Coupling.get_ICP(c) tcc += Cohesion.get_TCC(c) ich += Cohesion.get_ICH(c) lcom5 += Cohesion.get_LCOM5(c) # wmc += Complexity.get_WMC(c) nom += Complexity.get_NOM(c) instability += Stability.get_instability(c, model) print(model)