/* Copyright 1995  J. Hemmerle
** All Rights Reserved.
** Carnegie Mellon University
** Engineering Design Research Center
** $Author: mt1p $
** $Header: /usr0/mt1p/ateams/src/agent/RCS/memmonitor.h,v 6.3 1995/10/27 14:39:04 mt1p Exp $
** $Log: memmonitor.h,v $
 * Revision 6.3  1995/10/27  14:39:04  mt1p
 * Added a method to return the evals string
 *
 * Revision 6.2  1995/10/16  22:17:07  jsh
 * Change to store ateam_name also.
 *
 * Revision 6.1  1995/10/16  15:21:10  jsh
 * Initial version.
 *
** $Revision: 6.3 $
** $State: Exp $
*/

#ifndef MEMMONITOR_H
#define MEMMONITOR_H

#include "agent.h"

class MemMonitor : public Agent {
  private:
    PvmChannel	read_tid;
    int		read_id;
    char	*evals;
    double	(*scheduler)(Agent &agent);
    int		(*monitor)(Agent &agent, MHistory &history);
  public:
    MemMonitor(const char *name, const char *ateam_name,
	       int (*monitor)(Agent &agent, MHistory &history),
	       double (*scheduler)(Agent &),
	       char *evals, PvmChannel &memory_in);
    ~MemMonitor();
    DisplayHistory(MHistory &history) {return (*monitor)(*this, history);};
    int Execute(void);
    double Schedule(void) {return Agent::ScheduleAgent(scheduler);};
    Evaluation *RequestEvaluation(int solution_id, char *names) {
      return Agent::RequestEvaluation(read_tid, solution_id, names);};
    char *GetEvals() {return evals;}
};


#endif

