Commit b82f0262 authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

Update PSSMMutation.mutator

parent 68ffd910
......@@ -5,22 +5,22 @@ metamodel "/org.imt.tdl.PSSMMutation/data/model/statemachines.ecore"
with blocks {
ccs "Creates a connected state" {
randomState = select one State
randomState = select one Vertex where {self not typed FinalState}
newState = create State with {name = random-string(1, 4), ^container = randomState->^container}
create Transition with {^source = randomState, ^target = newState}
}
ccfs "Creates a connected final state "{
randomState = select one State where {self not typed FinalState}
randomState = select one Vertex where {self not typed FinalState}
fs = create FinalState with {name = random-string(1, 4), ^container = randomState->^container}
create Transition with {^source = randomState, ^target = fs}
}
ctr "Creates a transition with random source and target states"{
randomState1 = select one State where {self not typed FinalState and self not typed Pseudostate}
randomState2 = select one State where {self not typed FinalState and self not typed Pseudostate}
randomState1 = select one Vertex where {self not typed FinalState}
randomState2 = select one Vertex where {self not typed Pseudostate}
create Transition with {name = random-string(1, 4), ^source = randomState1, ^target = randomState2}
}
ctr2 "Creates a transition with source but without target state"{
randomState = select one State where {self not typed FinalState}
randomState = select one Vertex where {self not typed FinalState}
create Transition with {name = random-string(1, 4), ^source = randomState}
}
rtr "Removes a transition"{
......@@ -34,30 +34,30 @@ with blocks {
}
}
rst "Removes a state and adjacent transitions"{
remove one State
remove one Vertex
remove all Transition where {^source = null}
remove all Transition where {^target = null}
}
cis "Changes the initial state to a different one"{
initial1 = select one Pseudostate
transition = select one Transition where {^source is typed Pseudostate}
initial1 = select transition->^source
initial2 = select one Pseudostate where {self <> initial1}
transition = select one Transition where {^source = initial1}
modify transition with {^source = initial2}
}
cfs "Changes the final state to a different one"{
final1 = select one FinalState
transition = select one Transition where {^target is typed FinalState}
final1 = select transition->^target
final2 = select one FinalState where {self <> final1}
transition = select one Transition where {^target = final1}
modify transition with {^target = final2}
}
cst "Changes the source state of a transition"{
transition = select one Transition
state = select one State where {self <> transition->^source}
state = select one Vertex where {self not typed FinalState and self <> transition->^source}
modify transition with {^source = state}
}
rts "Changes the target state of a transition"{
transition = select one Transition
state = select one State where {self <> transition->^target}
state = select one Vertex where {self not typed Pseudostate and self <> transition->^target}
modify transition with {^target = state}
}
sdt "Swaps the direction of a transition"{
......@@ -83,16 +83,16 @@ with blocks {
action = create Behavior with {name = random-string(1, 4)}
modify one Transition with {effect = action}
}
cat "Changes the action of a transition"{
action = select one Behavior
transition = select one Transition where {effect <> action}
modify transition with {effect = action}
cat "Changes the action of a transition"{
transition = select one Transition where {effect <> null}
action = select one Behavior where {self <> transition->effect}
modify transition with {effect = action}
}
cas "Creates an action and set it to a state"{
action = create Behavior with {name = random-string(1, 4)}
modify one State where {self not typed FinalState and self not typed Pseudostate} with {entry = action}
modify one State where {self not typed FinalState} with {entry = action}
}
rco "Removes a constraint"{
remove one Constraint
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment