⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rrproj_solv.h

📁 aiParts is a set of C++ classes that can be used to develop artificial intelligence for multi-decisi
💻 H
📖 第 1 页 / 共 2 页
字号:
    return ( aiprrReqDay::req()->id() ); 
  }

  long proj_id () const { 
    return m_proj_id; 
  }

  rpsDecision * dcsn () const {
    return (rpsDecision*)(aiprrReqDay::dcsn());
  }

  aipTime  start_time () const { return m_start_time; }
  aipTime    end_time () const { return m_end_time;   }
  long       yyyymmdd () const { return m_yyyymmdd;   }

};


//======================================================================
//  rpsEmployee  -  an employee that can work positions
//
//  Parent classes provide id()

class rpsEmployee : public aiprrResource {

        // this last-work logic is adequate for event-scheduling
  aipG     m_g_last_work;
  aipTime  m_start_last_work;    // on first day of problem

public:

  rpsEmployee(long a_id, rpsProblem *a_prob);
  virtual ~rpsEmployee();

  virtual long num_keys (void) const { return 1; }
  virtual long     key1 (void) const { return aiprrResource::id(); }

  void add_empday  (rpsEmpDay *x);

  void set_start_last_work (aipTime x);
  void reset_g_last_work () { m_g_last_work = aipNeutral; }

  virtual void take_msg (aipMsg *m);
  // virtual void note_rps_decide (rpsDecision *d, rpsOption *o);

  rpsProblem * prob   () const { 
    return (rpsProblem*)(aiprrResource::prob()); 
  }

  long emp_id  () const { 
    return aiprrResource::id(); 
  }

  aipG  g_last_work () const { return m_g_last_work; }

  rpsEmpDayItr  empday_iterator() const;

};


//======================================================================
//  rpsEmpDay  -  an employee on a day
//
//  Parent classes provide day()

class rpsEmpDay : public aiprrResDay {

  aipTime    m_start_time;
  aipTime    m_end_time;

  long       m_yyyymmdd;

public:

  rpsEmpDay(rpsEmployee *a_emp, long a_yyyymmdd,
            long a_start_hhmm =800, long a_end_hhmm =2200);
  virtual ~rpsEmpDay() {}

  virtual long num_keys (void) const { return 2; }
  virtual long     key1 (void) const { return aiprrResDay::res()->id(); }
  virtual long     key2 (void) const { return m_yyyymmdd; }

  virtual void take_msg (aipMsg *m);
  // virtual void note_rps_decide (rpsDecision *d, rpsOption *o);

  rpsEmployee * emp () const { 
    return (rpsEmployee*)(aiprrResDay::res()); 
  }

  long emp_id () const { 
    return (aiprrResDay::res()->id()); 
  }

  aipTime  start_time () const { return m_start_time; }
  aipTime    end_time () const { return m_end_time;   }
  long       yyyymmdd () const { return m_yyyymmdd;   }

  rpsOptItr  opt_iterator() const;

};


//======================================================================
//  rpsPositionItr  -  Iterator for Positions in a Problem

class rpsPositionItr : public aipDemonItr {

public:

  rpsPositionItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsPositionItr (const rpsPositionItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsPositionItr () {}

  rpsPositionItr& operator = (const rpsPositionItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsPosition * first () {
    return (rpsPosition*)aipDemonItr::first();
  }

  rpsPosition * next () {
    return (rpsPosition*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsPosDayItr  -  Iterator for PosDays of a Position

class rpsPosDayItr : public aipDemonItr {

public:

  rpsPosDayItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsPosDayItr (const rpsPosDayItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsPosDayItr () {}

  rpsPosDayItr& operator = (const rpsPosDayItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsPosDay * first () {
    return (rpsPosDay*)aipDemonItr::first();
  }

  rpsPosDay * next () {
    return (rpsPosDay*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsEmployeeItr  -  Iterator for Employees in a Problem

class rpsEmployeeItr : public aipDemonItr {

public:

  rpsEmployeeItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsEmployeeItr (const rpsEmployeeItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsEmployeeItr () {}

  rpsEmployeeItr& operator = (const rpsEmployeeItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsEmployee * first () {
    return (rpsEmployee*)aipDemonItr::first();
  }

  rpsEmployee * next () {
    return (rpsEmployee*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsEmpDayItr  -  Iterator for EmpDays of an Employee

class rpsEmpDayItr : public aipDemonItr {

public:

  rpsEmpDayItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsEmpDayItr (const rpsEmpDayItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsEmpDayItr () {}

  rpsEmpDayItr& operator = (const rpsEmpDayItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsEmpDay * first () {
    return (rpsEmpDay*)aipDemonItr::first();
  }

  rpsEmpDay * next () {
    return (rpsEmpDay*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsDecisionItr  -  Iterator for Decisions in a Problem

class rpsDecisionItr : public aipDemonItr {

public:

  rpsDecisionItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsDecisionItr (const rpsDecisionItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsDecisionItr () {}

  rpsDecisionItr& operator = (const rpsDecisionItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsDecision * first () {
    return (rpsDecision*)aipDemonItr::first();
  }

  rpsDecision * next () {
    return (rpsDecision*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsOptItr  -  Iterator for Opts for an EmpDay

class rpsOptItr : public aipDemonItr {

public:

  rpsOptItr (aipPandemonium *p) {
    set_demon_itr(p,0);
  }

  rpsOptItr (const rpsOptItr& x) {
    set_demon_itr (x.pandemonium(), x.current());
  }

  virtual ~rpsOptItr () {}

  rpsOptItr& operator = (const rpsOptItr& x) {
    set_demon_itr(x.pandemonium(), x.current());
    return *this;
  }

  rpsOption * first () {
    return (rpsOption*)aipDemonItr::first();
  }

  rpsOption * next () {
    return (rpsOption*)aipDemonItr::next();
  }

};

//======================================================================
//  rpsMsg  -  message for rrproj problem-solving

class rpsMsg : public aiprrMsg {

public:

  rpsMsg (rpsProblem *p, short typ) : aiprrMsg(p,typ) {}
  ~rpsMsg() {}

};

//======================================================================

#endif

//======================================================================
//                           License
//
//   Permission is hereby granted, free of charge, to any
//   person obtaining a copy of this software and associated
//   documentation files (the "Software"), to deal in the Software
//   without restriction, including without limitation the rights
//   to use, copy, modify, merge, publish, distribute, sublicense,
//   and/or sell copies of the Software, and to permit persons to
//   whom the Software is furnished to do so, subject to the
//   following conditions:
//
//   The copyright notice and this license shall be included in all
//   copies or substantial portions of the Software.
//
//   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
//   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
//   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//   NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
//   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
//   OTHER DEALINGS IN THE SOFTWARE.
//
//**********************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -