<commit_before>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>, <NAME>
// =============================================================================
//
// Simple powertrain model for the M113 vehicle.
// - both power and torque limited
// - no torque converter
// - no transmission box
//
// =============================================================================

#include "chrono_models/vehicle/generic/Generic_SimpleMapPowertrain.h"

namespace chrono {
namespace vehicle {
namespace generic {

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
Generic_SimpleMapPowertrain::Generic_SimpleMapPowertrain()
    : ChPowertrain(),
      m_motorSpeed(0),
      m_motorTorque(0),
      m_shaftTorque(0),
      m_gear_ratios({-0.3333, 0.2857, 0.5155, 0.7937, 1.0753, 1.3158, 1.4815}),
      m_zeroThrottleMap({0, 52.360, 104.720, 157.080, 209.440, 261.799, 314.159, 366.519, 418.879, 471.239, 523.599,
                         575.959, 628.319, 654.498, 680.678, 706.858, 733.038, 785.398, 837.758},
                        {0.000 - 39.262, -39.263, -39.266, -39.272, -39.284, -39.307, -39.353, -39.447, -39.625,
                         -39.750, -39.875, -40.250, -41.500, -43.000, -46.000, -52.000, -64.000, -800.000}),
      m_fullThrottleMap({0, 52.360, 104.720, 157.080, 209.440, 261.799, 314.159, 366.519, 418.879, 471.239, 523.599,
                         575.959, 628.319, 654.498, 680.678, 706.858, 733.038, 785.398, 837.758},
                        {80.000, 80.000, 135.000, 200.000, 245.000, 263.000, 310.000, 358.000, 404.000, 455.000,
                         475.000, 485.000, 468.000, 462.000, 455.000, 427.000, 370.000, 259.000, -700.000}) {}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void Generic_SimpleMapPowertrain::Initialize(std::shared_ptr<ChBody> chassis, std::shared_ptr<ChShaft> driveshaft) {
    SetSelectedGear(1);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void Generic_SimpleMapPowertrain::SetSelectedGear(int igear) {
    assert(igear >= 0);
    assert(igear < m_gear_ratios.size());

    m_current_gear = igear;<commit_msg>Fix typo in Generic_SimpleMapPowertrain constructor...<commit_after>// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: <NAME>, <NAME>
// =============================================================================
//
// Simple powertrain model for the M113 vehicle.
// - both power and torque limited
// - no torque converter
// - no transmission box
//
// =============================================================================

#include "chrono_models/vehicle/generic/Generic_SimpleMapPowertrain.h"

namespace chrono {
namespace vehicle {
namespace generic {

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
Generic_SimpleMapPowertrain::Generic_SimpleMapPowertrain()
    : ChPowertrain(),
      m_motorSpeed(0),
      m_motorTorque(0),
      m_shaftTorque(0),
      m_gear_ratios({-0.3333, 0.2857, 0.5155, 0.7937, 1.0753, 1.3158, 1.4815}),
      m_zeroThrottleMap({0, 52.360, 104.720, 157.080, 209.440, 261.799, 314.159, 366.519, 418.879, 471.239, 523.599,
                         575.959, 628.319, 654.498, 680.678, 706.858, 733.038, 785.398, 837.758},
                        {0.000, - 39.262, -39.263, -39.266, -39.272, -39.284, -39.307, -39.353, -39.447, -39.625,
                         -39.750, -39.875, -40.250, -41.500, -43.000, -46.000, -52.000, -64.000, -800.000}),
      m_fullThrottleMap({0, 52.360, 104.720, 157.080, 209.440, 261.799, 314.159, 366.519, 418.879, 471.239, 523.599,
                         575.959, 628.319, 654.498, 680.678, 706.858, 733.038, 785.398, 837.758},
                        {80.000, 80.000, 135.000, 200.000, 245.000, 263.000, 310.000, 358.000, 404.000, 455.000,
                         475.000, 485.000, 468.000, 462.000, 455.000, 427.000, 370.000, 259.000, -700.000}) {}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void Generic_SimpleMapPowertrain::Initialize(std::shared_ptr<ChBody> chassis, std::shared_ptr<ChShaft> driveshaft) {
    SetSelectedGear(1);
}

// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
void Generic_SimpleMapPowertrain::SetSelectedGear(int igear) {
    assert(igear >= 0);
    assert(igear < m_gear_ratios.size());

    m_current_gear = igear;
{'fraction_non_alphanumeric': 0.3885416666666667, 'fraction_numerical': 0.16319444444444445, 'mean_word_length': 1.6820297951582868, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3019881', 'n_tokens_mistral': 2325, 'n_tokens_neox': 1600, 'n_words': 347}