#ifndef POSITION_EULER_H
#define POSITION_EULER_H

#ifndef EULER_H
#include "Euler.h"
#endif

#ifndef LOCK_H
#include "Lock.h"
#endif  

namespace MM
{

class Position_Euler : public Euler
{
    int     update_list_;
    double  skin_;

public:
    explicit Position_Euler (Prototype const &) {adopt_prototype (this);}
    explicit Position_Euler () :   update_list_(4), skin_(.5) { }
    char const* class_name () const {return "Position_Euler";}
    char const* title      () const {return "Position Euler";}
    char const* alias      () const {return "Euler-P";}
    MD_method * clone () const      {return new Position_Euler;}

protected:
    virtual void start ()
    {
        Lock<MD> lock(simulation());
        MD_method::start ();
        step_N_ = 0;
        list (MD_subject::Whole, skin_);
        F ();
    }

    virtual void        step   ()
    {
        Lock<MD> lock(simulation());

        drift (1.);

        if (step_N_ % update_list_ == 0)
            list (MD_subject::Whole, skin_);

        F ();
        kick  (1.);

        ++step_N_;
    }
};

}//MM

#endif //POSITION_EULER_H
