import net.mograsim.logic.model.model.components.submodels.SubmodelComponent;
import net.mograsim.logic.model.model.components.submodels.SubmodelInterface;
import net.mograsim.logic.model.model.wires.ModelWire;
-import net.mograsim.logic.model.model.wires.Pin;
import net.mograsim.logic.model.model.wires.ModelWireCrossPoint;
+import net.mograsim.logic.model.model.wires.Pin;
import net.mograsim.logic.model.modeladapter.componentadapters.ComponentAdapter;
public class LogicCoreAdapter
modelWire.setCoreModelBinding(modelWireSharedReadEnd.get(logicWiresPerPin.get(modelWire.getPin1())));
}
+ // TODO replace with a proper Union-Find datastructure
private static Map<Pin, Set<Pin>> getConnectedPinGroups(Set<Pin> allPins, Collection<ModelWire> wires)
{
Map<Pin, Set<Pin>> connectedPinsPerPin = new HashMap<>();
return connectedPinsPerPin;
}
+ public static final Map<Class<? extends ModelComponent>, Integer> gateCountsPerComponentClass = new HashMap<>();
+
@SuppressWarnings("unchecked")
private static <G extends ModelComponent> void createAndLinkComponent(Timeline timeline, CoreModelParameters params,
ModelComponent modelComponent, Map<Pin, CoreWire> logicWiresPerPin)
{
Class<?> cls = modelComponent.getClass();
+ gateCountsPerComponentClass.merge(modelComponent.getClass(), 1, Integer::sum);
ComponentAdapter<? super G> adapter = null;
while (cls != ModelComponent.class && adapter == null)
{