Skip to content

Commit

Permalink
Fixes #134
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo.rodriguez.mier committed Aug 3, 2015
1 parent c4ed9c9 commit bb67d88
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import es.usc.citius.hipster.model.Transition;
import es.usc.citius.hipster.model.function.TransitionFunction;
import es.usc.citius.hipster.util.F;
import es.usc.citius.hipster.util.Function;

import java.util.ArrayList;

Expand All @@ -37,13 +39,13 @@ public abstract class StateTransitionFunction<S> implements TransitionFunction<V

@Override
public Iterable<Transition<Void, S>> transitionsFrom(final S state) {
ArrayList<Transition<Void, S>> transitions = new ArrayList<Transition<Void, S>>();
//generate successor states
for(S current : successorsOf(state)){
//generate successor transitions from the states
transitions.add(new Transition<Void, S>(state, null, current));
}
return transitions;
return F.map(successorsOf(state), new Function<S, Transition<Void, S>>() {
@Override
public Transition<Void, S> apply(S current) {
return Transition.create(state, null, current);
}
});
}

/**
Expand Down

0 comments on commit bb67d88

Please sign in to comment.