Skip to content

Commit

Permalink
Merge branch 'reiner' into 'main'
Browse files Browse the repository at this point in the history
Documentation updated

See merge request oceandsl/oceandsl-tools!88
  • Loading branch information
Reiner Jung committed Aug 22, 2023
2 parents b11658c + b633ccd commit 44d8fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 79 deletions.
7 changes: 4 additions & 3 deletions doc/tools/mop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ Model Operation
===============

Merges models together from different sources or select a portion of the model.
In merge mode, the tool tries to infer whether two components from the input
models are the same based on their similarity in operations. The highest fit
is considered the corresponding component and merged.
The tool supports multiple merge approaches:
- merge = merge components with the same name
- nearest-merge = merge components with have the most similar operations.
- select = select a subset of the model

===== ===================== ======== ======================================================
Short Long Required Description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.eclipse.emf.common.util.EMap;

import kieker.model.analysismodel.deployment.DeployedComponent;
import kieker.model.analysismodel.deployment.DeployedOperation;
import kieker.model.analysismodel.deployment.DeployedStorage;
import kieker.model.analysismodel.deployment.DeploymentModel;
Expand Down Expand Up @@ -67,81 +66,6 @@ private static void mergeInvocations(final DeploymentModel deploymentModel, fina
}
}

private static void checkWhereResourceAreFrom(final DeploymentModel dm, final ExecutionModel em,
final String string) {
System.err.println("++++++ " + string);
em.getInvocations().forEach(entry -> {
checkPerOp(dm, entry.getKey().getFirst());
checkPerOp(dm, entry.getKey().getSecond());
checkPerOp(dm, entry.getValue().getCaller());
checkPerOp(dm, entry.getValue().getCallee());
});
}

private static void checkPerOp(final DeploymentModel dm, final DeployedOperation op) {
dm.getContexts().values().forEach(context -> {
context.getComponents().values().forEach(component -> {
final DeployedOperation dop = component.getOperations()
.get(op.getAssemblyOperation().getOperationType().getSignature());
if (dop != null) {
if (dop != op) {
System.err.println("OP " + op.eResource());
System.err.println("DOP " + dop.eResource());
} else {
// System.err.println("context " +
// op.eContainer().eContainer().eContainer().eContainer());
}
}
});
});
}

private static void checkDeployment(final DeploymentModel deploymentModel, final String string) {
System.err.println("###### " + string);
deploymentModel.getContexts().forEach(entry -> {
System.err.println(" context " + entry.getKey());
entry.getValue().getComponents().forEach(cEntry -> {
final DeployedComponent component = cEntry.getValue();
if (component.getContext() == null) {
System.err.printf(" component %s has no context\n", component.getSignature());
}
});
});
}

private static void checkExecution(final ExecutionModel em, final String name) {
System.err.println("!!!!! " + name);
em.getInvocations().entrySet().forEach(m -> {
final Tuple<DeployedOperation, DeployedOperation> key = m.getKey();
final Invocation value = m.getValue();
check(key.getFirst(), "first");
check(key.getSecond(), "second");
check(value.getCaller(), "caller");
check(value.getCallee(), "callee");
});
}

private static void check(final DeployedOperation op, final String string) {
final DeployedComponent dc = (DeployedComponent) op.eContainer().eContainer();
if (dc == null) {
System.err.println(
">> container " + op.getAssemblyOperation().getOperationType().getSignature() + " " + string);
return;
}
if (op.getComponent() == null) {
System.err.println(
">> component " + op.getAssemblyOperation().getOperationType().getSignature() + " " + string);
return;
}

if (dc.getAssemblyComponent().getComponentType() == null) {
System.err.println("shite " + string);
return;
}

// System.err.println("op " + op.getAssemblyOperation().getOperationType().getSignature());
}

private static boolean compareTupleOperationKeys(
final EMap<Tuple<DeployedOperation, DeployedOperation>, Invocation> invocations,
final Tuple<DeployedOperation, DeployedOperation> searchKey) {
Expand Down

0 comments on commit 44d8fbf

Please sign in to comment.