Search in sources :

Example 1 with SolverPriority

use of ch.hsr.servicecutter.solver.SolverPriority in project context-mapper-dsl by ContextMapper.

the class ServiceCutterOutputToContextMappingModelConverter method generateTopComment.

private String generateTopComment() {
    StringBuilder sb = new StringBuilder();
    sb.append("/* This CML model has been generated with Service Cutter. Timestamp: " + new SimpleDateFormat("dd.MM.YYYY HH:mm:ss z").format(new Date()));
    if (this.originalModelState != null)
        sb.append(System.lineSeparator() + " * It decomposes the original CML model " + originalModelState.eResource().getURI().toString() + ".");
    if (this.sclURI != null)
        sb.append(System.lineSeparator() + " * The following user representations file was used for the decomposition: " + sclURI.toString() + ".");
    if (this.serviceCutterContext != null) {
        SolverConfiguration config = serviceCutterContext.getSolverConfiguration();
        sb.append(System.lineSeparator() + " * ");
        sb.append(System.lineSeparator() + " * The service cut was generated with the following input parameters (.servicecutter.yml):");
        sb.append(System.lineSeparator() + " * Algorithm: " + config.getAlgorithm().name());
        for (Map.Entry<String, Double> entry : getAlgorithmParameters4Algo(config.getAlgorithmParams(), config.getAlgorithm()).entrySet()) sb.append(System.lineSeparator() + " * " + entry.getKey() + ": " + entry.getValue().toString());
        for (Map.Entry<String, SolverPriority> entry : config.getPriorities().entrySet()) sb.append(System.lineSeparator() + " * " + entry.getKey() + ": " + entry.getValue().name());
    }
    sb.append(System.lineSeparator() + " */");
    return sb.toString();
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) HashMap(java.util.HashMap) Map(java.util.Map) ContextMap(org.contextmapper.dsl.contextMappingDSL.ContextMap) SolverPriority(ch.hsr.servicecutter.solver.SolverPriority) Date(java.util.Date) SolverConfiguration(ch.hsr.servicecutter.solver.SolverConfiguration)

Aggregations

SolverConfiguration (ch.hsr.servicecutter.solver.SolverConfiguration)1 SolverPriority (ch.hsr.servicecutter.solver.SolverPriority)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ContextMap (org.contextmapper.dsl.contextMappingDSL.ContextMap)1