use of org.osate.aadl2.Classifier in project alisa-examples by osate.
the class ModelVerifications method sameVoltage.
public static boolean sameVoltage(ComponentInstance ci) {
EList<FeatureInstance> inlets = new BasicEList<FeatureInstance>();
for (FeatureInstance fi : ci.getAllFeatureInstances(FeatureCategory.ABSTRACT_FEATURE)) {
Classifier cl = fi.getFeature().getAllClassifier();
if (cl.getName().equalsIgnoreCase("power")) {
inlets.add(fi);
}
}
if (inlets.size() == 2) {
double v1 = getVoltage(inlets.get(0));
double v2 = getVoltage(inlets.get(1));
return v1 == v2;
}
return false;
}
use of org.osate.aadl2.Classifier in project alisa-examples by osate.
the class ModelVerifications method samePowerBudget.
public static boolean samePowerBudget(ComponentInstance ci) {
EList<FeatureInstance> inlets = new BasicEList<FeatureInstance>();
for (FeatureInstance fi : ci.getAllFeatureInstances(FeatureCategory.ABSTRACT_FEATURE)) {
Classifier cl = fi.getFeature().getAllClassifier();
if (cl.getName().equalsIgnoreCase("power")) {
inlets.add(fi);
}
}
if (inlets.size() == 2) {
double pb1 = GetProperties.getPowerBudget(inlets.get(0), 0.0);
double pb2 = GetProperties.getPowerBudget(inlets.get(1), 0.0);
return pb1 == pb2;
}
return false;
}
Aggregations