Package sg.edu.nus.comp.simTL.engine.tracing

Examples of sg.edu.nus.comp.simTL.engine.tracing.TraceLinkNode


      template.addChildTo(tParent, tParent2tChildRef, tChild, position, context);
      //introduce trace link!!
      modelCorrespondence.add(
          new TraceLink(
            (StaticContext)context, //neighbor has the same context presumably
            new TraceLinkNode(
              template,
              tChild
            ),
            new TraceLinkNode(
              instance,
              iChild
            )
          ));
      log.debug("Added " + Util.getFullName(tChild) + " to " + Util.getFullName(tParent) + " at " + position + "("+addAllocation.getAllocationType()+")");
View Full Code Here


       
        //introduce trace link
        modelCorrespondence.add(
            new TraceLink(
              (StaticContext)context, //context is been adapted
              new TraceLinkNode(
                template,
                tChild
              ),
              new TraceLinkNode(
                instance,
                tiChild
              )
            ));
       
      } else if(TForLoop.isTForLoop(tObject)){
        TForLoop forLoop = new TForLoop(tObject, context, template);
        EObject neighborInputElement = context.getVariableValue(forLoop.getName());
       
        Reference2Element pPointerToList = (Reference2Element)forLoop.getSetToBeIterated().getReferenceFromParent();
        List<EObject> parameterList = (List<EObject>)pPointerToList.getReferencedValue();
        if(parameterList.size()>0
            && (neighborInputElement==null
              ||!parameterList.contains(neighborInputElement))){
          throw new SimTLException("InputModel collection doesn't contain neighbor input element. It does contain other elements though");
         
        }
       
        Reference2Element pPointerToListElement = (Reference2Element)pPointerToList;
        EClass pClass = pPointerToListElement.getReferenceToChildren().getEReferenceType();
        //create new inputElement
        EObject pElement = pClass.getEPackage().getEFactoryInstance().create(pClass);
       
       
        if(pElement==null) throw new SimTLException("Couldn't instantiate parameter element type " + pClass.getName());
       
        //Add element to parameter model
        if(parameterList.size()>1){
          //It must be a new iteration => Existing is covered in position above
          boolean insertToRightOfParam = ((NewIterationAddAllocation)grayElementAddAllocation).isInsertToRightOfParam();
          int neighborIndex = parameterList.indexOf(neighborInputElement);
          int pIndex =
            insertToRightOfParam
              ?neighborIndex+1
              :neighborIndex;
          parameterModelHandler.addElement(pElement, pIndex, pPointerToList);
        } else {
          parameterModelHandler.addElement(pElement, Util.NO_POSITION, pPointerToList);
        }
       
        //Update context
        context = addVariableToContext(context, forLoop.getName(), pElement);
        //introduce trace link
        modelCorrespondence.add(
            new TraceLink(
              (StaticContext)context, //context is been adapted
              new TraceLinkNode(
                template,
                tChild
              ),
              new TraceLinkNode(
                instance,
                tiChild
              )
            ));
        log.debug("Added parameterElement in for-Loop: " + Util.getFullName(forLoop.getTElement()) + " Element: " + Util.getFullName(pElement));
View Full Code Here

    }
   
    modelCorrespondence.add(
        new TraceLink(
          currentContext.saveToStaticContext(),
          new TraceLinkNode(
            template,
            tObject
          ),
          new TraceLinkNode(
            instance,
            iObject
          )
        ));
   
View Full Code Here

   
    if(checkActualAttribute(tAttributeClass,iAttributeClass,tObject,iObject)){
      modelCorrespondence.add(
          new TraceLink(
            currentContext.saveToStaticContext(),
            new TraceLinkNode(
              template,
              new Reference2Attribute(
                tObject,
                tAttributeClass
              )
            ),
            new TraceLinkNode(
              instance,
              new Reference2Attribute(
                iObject,
                iAttributeClass
              )
            )
          ));
    } else{
      ReferenceFromParent refFromParent =
        checkPlaceholder(tAttributeClass,iAttributeClass,tObject,iObject);
      if(refFromParent!=null){
        //HANDLE TRACELINK
        //1) importedModel - resultModel
        StaticContext staticContext = currentContext.saveToStaticContext();
        modelCorrespondence.add(
          new TraceLink(
            staticContext,
            new TraceLinkNode(
              getImportedModel(refFromParent.getParent().eResource()),
              (Reference2Attribute)refFromParent
            ),
            new TraceLinkNode(
              instance,
              new Reference2Attribute(
                iObject,
                iAttributeClass
              )
View Full Code Here

   
    changeAttributeWithOperations(pPointer2Att, iValue);
   
    //Add trace link if not already exists!
   
    TraceLinkNode pTLN =new TraceLinkNode(
        findInputModel(pPointer2Att.getParent().eResource()),
        pPointer2Att);
    TraceLinkNode iTLN =new TraceLinkNode(
        template,
        iPointerToAtt);
   
    TraceLink traceLink = modelCorrespondence.getTraceLink(pTLN,iTLN);
    if(traceLink==null){
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.tracing.TraceLinkNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.