public void endModule() { if (mCMFake == null) throw new RuntimeException("A module clause is ending without" + "initialization."); Module mReal; if (mModuleModel.getModuleMap().get(mCMFake.getName()) != null) { mReal = mModuleModel.getModuleMap().get(mCMFake.getName()); } else mReal = new Module(mCMFake); // partitionIds are equal to 1 or 2 in the current module model. We decrease the Id by one, in // order // to properly assign the values for the partition Ids to the array of values in the modules. mReal.setExecutionCost(mCMFake.getExecutionCost(), mCMFake.getPartitionId() - 1); mReal.setExecutionCount(mCMFake.getExecutionCount(), mCMFake.getPartitionId() - 1); mReal.setPartitionId(-1); mModuleModel.getModuleMap().put(mReal.getName(), mReal); mList.add(mCMFake); mCMFake = null; }
public void setModulePartition(String partitionId) { if (mCMFake == null) throw new RuntimeException("No module to assign the partition" + "for Id: " + partitionId); mCMFake.setPartitionId(Integer.parseInt(partitionId)); }