// This may look like C code, but it is really -*- C++ -*-
// RTSS --- Railway Total System Simulator
// (c) TAKAGI Ryo (at Kogakuin University)
// trn_btws.cc --- class train functions on nextmotion: nm_stnbtws
// -----
// ChangeLog:
// 2007. 11. 22
//  Redirected log messages to l_file.
// -----

#include <cstdio>
#include <cstdlib>
#include <cmath>

#include "train.hh"
#include "StrPrintf.hh"

#define INVLIM 1e-5

//#define DEBUG
//#define TIMEPRINT

// 駅間停車が終わったら力行開始
void train::nm_stnbtws
( double tracff ) {
#ifdef DEBUG
  cerr << StrPrintf ( "nm_stnbtws, tracff = %.1f" , tracff ) << endl ;
#endif
    if ( g_sw_station_object_valid && g_sw_disttrain_ended ) {
        // 信号系が有効である時のみ *** 注意 ***
        if ( nxx->stnobj()->voie_occupied( this ) ) {
            return;	// 発車できない
        }
    }
    stat = Power;
    iamconst = true;	iamcoast = false;
    ontprec = nxx->get_ontprec();
    rnotchold = rnotch = 1.0;
}
