Jacob,

Thank you so much, I've figured it out after your last elaboration on
arguments and parameters.

Best Regards,
Sadullah.

On Sat, Oct 23, 2021 at 5:35 PM Jakob Erdmann <[email protected]> wrote:

> This is turning into a general C++ question (maybe get a local programmer
> to help you out).
> Your current constructor takes 1 argument (vType) but you call it with 4
> arguments (type and 3 parameters).
>
>
> Am Sa., 23. Okt. 2021 um 13:06 Uhr schrieb S G <[email protected]>:
>
>> Jacob,
>>
>> Thanks for the reply. I've changed the from.get call to from.getCFParam
>> as you have suggested.
>>
>>         case SUMO_TAG_CF_GM:
>>             vtype->myCarFollowModel = new MSCFModel_GM(vtype,
>>                 from.getCFParam(SUMO_ATTR_GM_Alpha,1.),
>>                 from.getCFParam(SUMO_ATTR_GM_M, 1.),
>>                 from.getCFParam(SUMO_ATTR_GM_L, 1.));
>>             break;
>>
>> But I am still having rouble with the second error "no overloaded
>> function takes 4 arguments". at MSVehicleType.cpp
>>
>> Even though I've declared my parameters in both .h and .cpp file, I am
>> still getting the same error.
>>
>> In cpp file, I have wrote the following
>>
>> MSCFModel_GM::MSCFModel_GM(const MSVehicleType* vtype) :
>>     MSCFModel(vtype),
>>     myalpha(vtype->getParameter().getCFParam(SUMO_ATTR_GM_Alpha, 1.0)),
>> // This is the sensitivity parameter, default value is set to 1
>>     myM(vtype->getParameter().getCFParam(SUMO_ATTR_GM_M, -2.0)), // This
>> is the speed exponent, takes values between -2 to +2
>>     myL(vtype->getParameter().getCFParam(SUMO_ATTR_GM_L, 4.0)) { // This
>> is the distance headway exponent, takes values between +4 to -1
>>
>>
>> }
>>
>> MSCFModel_GM::~MSCFModel_GM() {}
>>
>>
>> and in .h file, I have declared the myalpha , myM and myL as the following
>>
>> private:
>>     /// @name model parameter
>>     /// @{
>>     /// @brief General Motors sensitivity
>>     double myalpha;
>>
>>     /// @brief General Motors speed exponent
>>     double myM;
>>
>>     /// @brief General Motors Distance Headway Exponent
>>     double myL;
>>     /// @}
>>
>>
>> I would really appreciate the help.
>>
>> Best Regards,
>> Sadullah.
>>
>> On Sat, Oct 23, 2021 at 11:56 AM Jakob Erdmann <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> - the call from.get is obsolete and from.getCFParam is correct
>>> (documentation has been updated).
>>> - the make the constructor call 'new MSCFModel_GM( ... )' with 4
>>> parameters work, you have to define a corresponding constructor in
>>> MSCFModel_GM.h and .cpp
>>>
>>> regards,
>>> Jakob
>>>
>>>
>>> Am Sa., 23. Okt. 2021 um 02:25 Uhr schrieb S G <[email protected]
>>> >:
>>>
>>>> Greetings,
>>>>
>>>> I am trying to implement a car-following model (General Motors model)
>>>> to SUMO. I've successfully downloaded the developer version and compiled
>>>> (built) the code on windows.
>>>>
>>>> However, I am having some trouble with the implementation of a
>>>> car-following model. I've followed and completed every step in the guide at
>>>> the documentation (
>>>> https://sumo.dlr.de/docs/Developer/How_To/Car-Following_Model.html).
>>>> My main issue occurs at the "MSVehicleType.cpp" when I try to compile
>>>> again. According to the documentation, I need to add the following to the
>>>> "MSVehicleType.cpp" ;
>>>>
>>>>         case SUMO_TAG_CF_GM:
>>>>             model = new MSCFModel_GM(vtype,
>>>>                 from.get(SUMO_ATTR_GM_Alpha,1.),
>>>>                 from.get(SUMO_ATTR_GM_M, 1.),
>>>>                 from.get(SUMO_ATTR_GM_L, 1.));
>>>>             break ;
>>>>
>>>> However, when I try to compile the code again, the "from.get" command
>>>> does not work and build fails around step 390-400 with the following 
>>>> errors;
>>>>
>>>>    - 'get': is not a member of 'SUMOVTypeParameter'7
>>>>    - model : undeclared identifier
>>>>
>>>> I have tried the following as well, which is the current format for the
>>>> car-following models already existing inside the MSVehicleType.cpp
>>>>
>>>>         case SUMO_TAG_CF_GM:
>>>>             vtype->myCarFollowModel = new MSCFModel_GM(vtype,
>>>>                 from.getCFParam(SUMO_ATTR_GM_Alpha,1.),
>>>>                 from.getCFParam(SUMO_ATTR_GM_M, 1.),
>>>>                 from.getCFParam(SUMO_ATTR_GM_L, 1.));
>>>>             break ;
>>>>
>>>> When I compile this I get the error that "no overloaded function takes
>>>> 4 arguments.
>>>>
>>>> Another version I've tried
>>>>
>>>>         case SUMO_TAG_CF_GM:
>>>>             vtype->myCarFollowModel = new MSCFModel_GM(vtype)
>>>>              break ;
>>>>
>>>> At this version, compile procedure successfully runs to the step 740
>>>> but fails with an error message as follows :
>>>>
>>>> [740/1025]
>>>> C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\cl.exe
>>>>  /nologo /TP -DFLOAT_MATH_FUNCTIONS
>>>> -IC:\SUMOLibraries\googletest-1.10.0\include -Isrc -I..\..\..\src
>>>> -IC:\SUMOLibraries\xerces-c-3.2.3\include
>>>> -IC:\SUMOLibraries\proj-7.2.0\include -IC:\SUMOLibraries\fox-1.6.57\include
>>>> -IC:\SUMOLibraries\freetype-2.10.4\include\freetype2
>>>> -IC:\SUMOLibraries\3rdPartyLibs\zlib-1.2.11\include
>>>> -IC:\SUMOLibraries\gdal-3.2.1\include
>>>> -IC:\SUMOLibraries\FFMPEG-4.2.0\include
>>>> -IC:\SUMOLibraries\OSG-3.6.5\include -IC:\SUMOLibraries\gl2ps-1.4.0\include
>>>> -IC:\SUMOLibraries\eigen-3.3.9 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MP /bigobj
>>>> /MD /O2 /Ob2 /DNDEBUG /showIncludes
>>>> /Fosrc\utils\gui\images\CMakeFiles\utils_gui_images.dir\GUIIconSubSys.cpp.obj
>>>> /Fdsrc\utils\gui\images\CMakeFiles\utils_gui_images.dir\utils_gui_images.pdb
>>>> /FS -c ..\..\..\src\utils\gui\images\GUIIconSubSys.cpp
>>>>   [741/1025] cmd.exe /C "cd /D
>>>> C:\Users\l\source\repos\sumo\out\build\x64-Release\src\libsumo &&
>>>> "C:\Program Files (x86)\Microsoft Visual
>>>> Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
>>>> -E make_directory C:/Users/source/repos/sumo/tools/libsumo
>>>> C:/Users//source/repos/sumo/out/build/x64-Release/src/libsumo &&
>>>> "C:\Program Files (x86)\Microsoft Visual
>>>> Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
>>>> -E env SWIG_LIB=C:/SUMOLibraries/swigwin-4.0.2/Lib
>>>> C:/SUMOLibraries/swigwin-4.0.2/swig.exe -python -keyword -outdir
>>>> C:/Users/source/repos/sumo/tools/libsumo -c++ -interface _libsumo
>>>> -IC:/SUMOLibraries/googletest-1.10.0/include
>>>> -IC:/SUMOLibraries/xerces-c-3.2.3/include
>>>> -IC:/SUMOLibraries/proj-7.2.0/include -IC:/SUMOLibraries/fox-1.6.57/include
>>>> -IC:/SUMOLibraries/freetype-2.10.4/include/freetype2
>>>> -IC:/SUMOLibraries/3rdPartyLibs/zlib-1.2.11/include
>>>> -IC:/SUMOLibraries/gdal-3.2.1/include
>>>> -IC:/SUMOLibraries/FFMPEG-4.2.0/include
>>>> -IC:/SUMOLibraries/OSG-3.6.5/include -IC:/SUMOLibraries/gl2ps-1.4.0/include
>>>> -IC:/SUMOLibraries/eigen-3.3.9
>>>> -IC:/Users/source/repos/sumo/out/build/x64-Release/src
>>>> -IC:/Users/source/repos/sumo/src -IC:/Users/anaconda3/include -o
>>>> C:/Users/source/repos/sumo/out/build/x64-Release/src/libsumo/libsumoPYTHON_wrap.cxx
>>>> C:/Users/source/repos/sumo/src/libsumo/libsumo.i"
>>>>   ninja: build stopped: subcommand failed.
>>>>
>>>>
>>>> Another common error I get at is the following:
>>>>
>>>> Severity Code Description Project File Line Suppression State Detail
>>>> Description
>>>> Error (active) E0289 no instance of constructor
>>>> "MSCFModel_GM::MSCFModel_GM" matches the argument list microsim.lib
>>>> (src\microsim\microsim.lib) - x64-Release
>>>> C:\Users\sadul\source\repos\sumo\src\microsim\MSVehicleType.cpp 356
>>>>    argument types are: (MSVehicleType *, double, double, double)
>>>>
>>>>
>>>> Sorry for the long e-mail but I would really appreciate any help. You
>>>> can find the code files in the attachment as well.
>>>>
>>>> Best Regards,
>>>> Sadullah.
>>>> _______________________________________________
>>>> sumo-user mailing list
>>>> [email protected]
>>>> To unsubscribe from this list, visit
>>>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>>>
>>> _______________________________________________
>>> sumo-user mailing list
>>> [email protected]
>>> To unsubscribe from this list, visit
>>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>>
>> _______________________________________________
>> sumo-user mailing list
>> [email protected]
>> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to