[pdp-discuss] small fix for your consideration
Richard Jones
dickjr at gmail.com
Fri Oct 20 15:52:18 MDT 2006
Hi All,
I was having trouble getting my EpochProcess to step correctly when I
wanted the step level to be below the Epoch. I found that a while
loop in the ShedProcess::Step() function that wants to set the
im_step_proc flag at the right process level was stopping one level
too early. The fix I made below seems to correct the problem, with
the added benefit that the step number is also correctly set at my
desired step level (which also wasn't happening).
This was changed in ...src/pdp/sched_proc.cc. I also noticed that the
leabra++ app doesn't have this problem.
void SchedProcess::Step() {
if(running) {
taMisc::Choice("A process is already running.", "Ok");
return; // already running
}
if((network != NULL) && (network->views.size > 0) && (step.proc != NULL)) {
((NetView*)network->views.DefaultEl())->AddUpdater(step.proc);
}
SchedProcess* sp = this;
// based on the sub_proc, not the proc itself.
// set step flags of all containing procs
//**** I REPLACED THIS LINE
// while((sp != NULL) && (this != step.proc) && (sp->sub_proc != step.proc)) {
//**** WITH THIS LINE
while((sp != NULL) && (sp != step.proc)) {
sp->im_step_proc = false;
sp = sp->sub_proc;
}
if(sp == NULL) return;
sp->im_step_proc = true; // flag the step process
sp->step.n = step.n; // copy step n down here, where it is actually used
stepping = true; // actually doing a step
Run_gui();
}
--
Richard Jones
dickjr at gmail.com
More information about the PDP-Discuss
mailing list