Skip to content
Snippets Groups Projects
Commit 15833666 authored by Alex's avatar Alex
Browse files

supervisor's resetting

parent e4d64d02
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ class Supervisor(val pb : DCOP, val algorithm: Algorithm) extends Actor with Sta
with FSM[SupervisorState, SupervisorStatus] {
var debug = true
var debugState = false
var debugState = true
var trace = false
var solver: ActorRef = context.parent // Reference to the distributed solver
......@@ -162,13 +162,13 @@ class Supervisor(val pb : DCOP, val algorithm: Algorithm) extends Actor with Sta
//when it receives its own decison that it should continue
case Event(ContinueAlgo, status) => {
//TODO reset the context it has
val newStatus: SupervisorStatus = status.SupervisorStatus(status)//TODO reset the context it has
unstashall
goto(RunningSupervisorState) using status
}
case Event(StopAlgo, status) => {
//TODO ???
goto(FinalSupervisorState) using status
}
}
......
......@@ -41,4 +41,14 @@ class SupervisorStatus(val readyVariables: Set[Variable] = Set(),
* @todo modify it
*/
def isTerminated : Boolean = ! isFirstRound
def resetContext(currStatus: SupervisorStatus): SupervisorStatus {
new SupervisorStatus(readyVariables,
inactiveVariables,
killedVariables,
assignment new Context(),
metric,
isFirstRound
)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment