//
// MATLAB Compiler: 2.2
// Date: Wed Mar 10 16:44:47 2004
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
// "array_indexing:on" "-O" "optimize_conditionals:on" "-p" "-W" "main" "-L"
// "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "hier_community.m" "Default.m" "Stop_Simulation.m"
// "Call_SaveLoad_Fig.m" "SaveLoad_Fig.m" "SaveLoad.m" "Load_Population_Data.m"
// "Save_Population_Data.m" "Start_hier_community.m" "MyInline.m" "My_Eval.m"
// "isnumber.m" "Find_Var.m" "Change_Number_of_Populations.m"
// "Switch_Populations.m" "Store_Parameters.m" 
//
#include "Stop_Simulation.hpp"
#include "libmatlbm.hpp"

static mxChar _array1_[148] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'S', 't', 'o', 'p', '_',
                                'S', 'i', 'm', 'u', 'l', 'a', 't', 'i', 'o',
                                'n', ' ', 'L', 'i', 'n', 'e', ':', ' ', '1',
                                ' ', 'C', 'o', 'l', 'u', 'm', 'n', ':', ' ',
                                '1', ' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n',
                                'c', 't', 'i', 'o', 'n', ' ', '"', 'S', 't',
                                'o', 'p', '_', 'S', 'i', 'm', 'u', 'l', 'a',
                                't', 'i', 'o', 'n', '"', ' ', 'w', 'a', 's',
                                ' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ', 'w',
                                'i', 't', 'h', ' ', 'm', 'o', 'r', 'e', ' ',
                                't', 'h', 'a', 'n', ' ', 't', 'h', 'e', ' ',
                                'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ',
                                'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o', 'f',
                                ' ', 'o', 'u', 't', 'p', 'u', 't', 's', ' ',
                                '(', '0', ')', '.' };
static mwArray _mxarray0_ = mclInitializeString(148, _array1_);

static mxChar _array3_[147] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'S', 't', 'o', 'p', '_',
                                'S', 'i', 'm', 'u', 'l', 'a', 't', 'i', 'o',
                                'n', ' ', 'L', 'i', 'n', 'e', ':', ' ', '1',
                                ' ', 'C', 'o', 'l', 'u', 'm', 'n', ':', ' ',
                                '1', ' ', 'T', 'h', 'e', ' ', 'f', 'u', 'n',
                                'c', 't', 'i', 'o', 'n', ' ', '"', 'S', 't',
                                'o', 'p', '_', 'S', 'i', 'm', 'u', 'l', 'a',
                                't', 'i', 'o', 'n', '"', ' ', 'w', 'a', 's',
                                ' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ', 'w',
                                'i', 't', 'h', ' ', 'm', 'o', 'r', 'e', ' ',
                                't', 'h', 'a', 'n', ' ', 't', 'h', 'e', ' ',
                                'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd', ' ',
                                'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o', 'f',
                                ' ', 'i', 'n', 'p', 'u', 't', 's', ' ', '(',
                                '0', ')', '.' };
static mwArray _mxarray2_ = mclInitializeString(147, _array3_);

static mxChar _array5_[3] = { 'T', 'a', 'g' };
static mwArray _mxarray4_ = mclInitializeString(3, _array5_);

static mxChar _array7_[23] = { 'F', 'i', 'g', '_', 'm', 'u', 'l', 't',
                               'i', 'p', 'l', 'e', '_', 'p', 'o', 'p',
                               'u', 'l', 'a', 't', 'i', 'o', 'n' };
static mwArray _mxarray6_ = mclInitializeString(23, _array7_);

static mxChar _array9_[8] = { 'U', 's', 'e', 'r', 'D', 'a', 't', 'a' };
static mwArray _mxarray8_ = mclInitializeString(8, _array9_);
static mwArray _mxarray10_ = mclInitializeDouble(1.0);

static mxChar _array12_[4] = { 'I', 'D', 'L', 'E' };
static mwArray _mxarray11_ = mclInitializeString(4, _array12_);

void InitializeModule_Stop_Simulation() {
}

void TerminateModule_Stop_Simulation() {
}

static void MStop_Simulation();

_mexLocalFunctionTable _local_function_table_Stop_Simulation
  = { 0, (mexFunctionTableEntry *)NULL };

//
// The function "Stop_Simulation" contains the normal interface for the
// "Stop_Simulation" M-function from file
// "C:\shu\hier_community_exe\Stop_Simulation.m" (lines 1-7). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
void Stop_Simulation() {
    MStop_Simulation();
}

//
// The function "mlxStop_Simulation" contains the feval interface for the
// "Stop_Simulation" M-function from file
// "C:\shu\hier_community_exe\Stop_Simulation.m" (lines 1-7). The feval
// function calls the implementation version of Stop_Simulation through this
// function. This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void mlxStop_Simulation(int nlhs,
                        mxArray * plhs[],
                        int nrhs,
                        mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        if (nlhs > 0) {
            error(_mxarray0_);
        }
        if (nrhs > 0) {
            error(_mxarray2_);
        }
        MStop_Simulation();
    }
    MW_END_MLX();
}

//
// The function "MStop_Simulation" is the implementation version of the
// "Stop_Simulation" M-function from file
// "C:\shu\hier_community_exe\Stop_Simulation.m" (lines 1-7). It contains the
// actual compiled code for that M-function. It is a static function and must
// only be called from one of the interface functions, appearing below.
//
//
// function Stop_Simulation
//
static void MStop_Simulation() {
    mwLocalFunctionTable save_local_function_table_
      (&_local_function_table_Stop_Simulation);
    mwArray ans(mclGetUninitializedArray());
    mwArray data(mclGetUninitializedArray());
    mwArray multiple_population_handle(mclGetUninitializedArray());
    //
    // 
    // multiple_population_handle = findobj('Tag','Fig_multiple_population');
    //
    multiple_population_handle = findobj(mwVarargin(_mxarray4_, _mxarray6_));
    //
    // data = get(multiple_population_handle,'UserData');
    //
    data
      = Nget(
          1,
          mwVarargin(
            mwVv(multiple_population_handle, "multiple_population_handle"),
            _mxarray8_));
    //
    // data{1} = 'IDLE';
    //
    data.cell(_mxarray10_) = _mxarray11_;
    //
    // set(multiple_population_handle,'UserData',data);
    //
    ans.EqAns(
      Nset(
        0,
        mwVarargin(
          mwVv(multiple_population_handle, "multiple_population_handle"),
          _mxarray8_,
          mwVv(data, "data"))));
}
