Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
/*
* Copyright (c) Ericsson AB, 2013
/*
* Copyright (c) 2012, Ericsson AB
* All rights reserved.
*
* License terms:
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the Ericsson AB nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
/*
* Copyright (c) Ericsson AB, 2013
/*
* Copyright (c) 2012, Ericsson AB
* All rights reserved.
*
* License terms:
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* * Neither the name of the copyright holder nor the names
* of its contributors may be used to endorse or promote
* products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the Ericsson AB nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import org.caltoopia.analysis.air.ActorImplementation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.io.PrintStream;
Expand Down Expand Up @@ -82,8 +81,9 @@ public void print(GenericActorAnalysis analysis) {

}
else {
if (!actor.hasImplementation())
mOut.print("extern/unknown implementation, ");
if (!actor.hasImplementation()){
mOut.print("extern/unknown implementation");
}
mOut.println("actor not analyzed");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import org.caltoopia.analysis.air.Connection;
Expand All @@ -49,7 +48,7 @@ public enum ConnectionType {

private Connection connection;
private ConnectionType type = ConnectionType.UNCLASSIFIED;
private Integer initialTokens;
private Integer initialTokens = new Integer(0);
private Integer tokenSize;


Expand All @@ -58,7 +57,6 @@ public ConnectionAnalysis(Connection c, GenericActorAnalysis srcActorAnalysis){
connection = c;

//Assign initial tokens
initialTokens = null;
if(srcActorAnalysis!=null){
if (srcActorAnalysis.hasStaticSchedule()
&& srcActorAnalysis.getStaticSchedule().hasTransientPhase()) {
Expand All @@ -71,8 +69,7 @@ public ConnectionAnalysis(Connection c, GenericActorAnalysis srcActorAnalysis){
}
}
}
else
initialTokens = new Integer(0);


//Assign token size
tokenSize = new Integer(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.Collection;
Expand Down Expand Up @@ -97,14 +96,15 @@ protected class AnnotatedActionProperty{
protected List<AnnotatedActionProperty> annotatedActionProperties = new ArrayList<AnnotatedActionProperty>();
private Integer executionTime = null;
private Integer stateSize = null;
private Integer id = new Integer(0);
private boolean typeAnnotated = false;

public GenericActorAnalysis(ActorInstance actor, ActorAnalysis delegate) {
mActor=actor;
actorAnalysis=delegate;
mActorType = ActorInstanceType.UNCLASSIFIED;

stateSize = new Integer(0);
stateSize = new Integer(1);
executionTime = new Integer(0);
for(PortInstance portInstance : mActor.getPorts()){
PortAnalysis portAnalysis = new PortAnalysis(portInstance);
Expand Down Expand Up @@ -224,6 +224,14 @@ protected void setExecutionTime(Integer t){

}

public Integer getId(){
return id;
}

public void setId(Integer t){
id = t;
}

public Integer getStateSize(){
return stateSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.AbstractList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
*/
package org.caltoopia.analysis.actor;


import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.caltoopia.analysis.air.Action;
import org.caltoopia.analysis.air.ActorImplementation;
import org.caltoopia.analysis.air.Guard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.caltoopia.analysis.actor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.caltoopia.analysis.actor.GenericActorAnalysis.AnnotatedActionProperty;
import org.caltoopia.analysis.actor.McdfActorAnalysis.McdfActorInstanceType;
import org.caltoopia.analysis.actor.PortAnalysis.PortType;
import org.caltoopia.analysis.air.Action;
import org.caltoopia.analysis.air.ActorInstance;
Expand All @@ -50,6 +52,7 @@
import org.caltoopia.analysis.air.PortSignature;
import org.caltoopia.analysis.air.State;
import org.caltoopia.analysis.air.Transition;
import org.caltoopia.analysis.air.PortInstance.Direction;
import org.caltoopia.analysis.util.collections.UnionOfDisjointIntervals;
import org.caltoopia.ast2ir.Stream;

Expand Down Expand Up @@ -226,6 +229,9 @@ public void print(Stream stream){
//flags if this actor is the source actor of the network
private Boolean source = new Boolean(false);

//flags if this actor is going to be skip in extraction
private Boolean ignore = new Boolean(false);

/**
* constructs a ScenarioAwareActorAnalysis object
* It sets the actor instance type either from annotation or
Expand Down Expand Up @@ -265,6 +271,13 @@ else if(type.equalsIgnoreCase("sa_detector")){
source = Boolean.TRUE;
}

//check if this actor is a source actor
String ign = getActor().getAnnotationArgumentValue("ActorProperty","Ignore");
if(ign!=null){
if (ign.trim().equalsIgnoreCase("true"))
ignore = Boolean.TRUE;
}

//if actor is not type-annotated, classify the actor by analysis
if(!isTypeAnnotated()){
if(isScenarioAwareStaticActor())
Expand All @@ -291,6 +304,14 @@ public boolean isSource(){
return source.booleanValue();
}

/**
* checks if this actor is to be ignored
* @return true if actor is ignored or false, otherwise.
*/
public boolean isActorIgnored(){
return ignore.booleanValue();
}

/**
* gets the possible scenarios of the actor
* @return
Expand Down Expand Up @@ -513,7 +534,9 @@ public void constructDynamicScenarios(){

//Add to the list of scenario properties
scenarios.add(scenario);

guardedTransitions.add(transition);
}
}
//Update for the next state
State dstState = transition.getTargetState();
if(!visitedStates.contains(dstState)){
Expand All @@ -522,9 +545,7 @@ public void constructDynamicScenarios(){
transitionsQueue.add(t);
}
}
guardedTransitions.add(transition);
}
}

}
}

Expand Down
Loading