// Matt Streeter
// 2/27/00
// BACKPROP.H
// Header for class TBackpropWindow; implementation "Backprop Control" window
// spawned by TNVisWindow.
// Copyright Matt Streeter, 2000. All rights reserved
#ifndef __BACKPROP_H__
#define __BACKPROP_H__
#include <owl\button.h>
#include "eswindow.h"
#include "types.h"
#include "esstatic.h"
// Set to 1 to run the backpropagation algorithm as a separate thread (only
// available under Win32).
#define USE_THREADS 0
class TNVisWindow;
#if(USE_THREADS)
#include <classlib\thread.h>
class TBackpropWindow;
class BackpropThread : public TThread
{
public:
BackpropThread(TBackpropWindow *pBackpropWin) {mpBackpropWin=pBackpropWin;}
private:
unsigned long Run();
TBackpropWindow *mpBackpropWin;
};
#endif
class TBackpropWindow: public TESWindow
{
public:
TBackpropWindow(TWindow *pParent,TNVisWindow *pNParent,
TBackpropWindow **ppThis);
void Paint(TDC&, bool, TRect&);
bool IdleAction(long idleCount);
~TBackpropWindow();
void UpdateIterationNumStatic();
void UpdateFitnessScoreStatic();
void IncrementIteration() {mlIteration++;}
void BackProp();
protected:
void HandlePauseButtonMsg();
void HandleResumeButtonMsg();
private:
long mlIteration;
TESStatic *mpIterationNumStatic,*mpFitnessScoreStatic;
TNVisWindow *mpNParent;
TBackpropWindow **mppThis;
TButton *mpPauseButton,*mpResumeButton;
byte mbRunning;
#if(USE_THREADS)
TThread *mpBackpropThread;
#endif
DECLARE_RESPONSE_TABLE(TBackpropWindow);
};
#endif // __BACKPROP_H__