Created
May 5, 2013 16:18
-
-
Save anonymous/5521287 to your computer and use it in GitHub Desktop.
How do I parameterize my FSM's StateData?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object NeuroCon { | |
sealed trait StateName | |
object ReadyState extends StateName | |
object ProcState extends StateName | |
sealed trait StateData | |
case class ReadyData(net: ActorRef) extends StateData | |
case class ProcData(net: ActorRef, task: ActorRef, env: TaskEnv) extends StateData | |
} | |
import NeuroCon._ | |
class NeuroCon[TaskEnv, TaskAct](sensorArray: (TaskEnv) => StimVec, topTpl: TopTpl, actuatorArray: (TaskEnv, RespVec) => TaskAct) extends Actor with LoggingFSM[StateName, StateData] { | |
startWith(ReadyState, ReadyData(context.actorOf(Props(new Network(topTpl))))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment