Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Envmod usage #67

Closed
rtobi opened this issue Mar 14, 2019 · 7 comments
Closed

Envmod usage #67

rtobi opened this issue Mar 14, 2019 · 7 comments

Comments

@rtobi
Copy link

rtobi commented Mar 14, 2019

Hi,

I am currently trying to get running your environment model. Looking at your highway-police example, I do not get how you include this model. In the services.xml the PoliceService is configured, while in services-envmod.xml the PoliceServiceEnvmod is configured. Running the example without any changes does never call a function from the PoliceServiceEnvmod class. Changing the services.xml file such that the PoliceServiceEnvmod class is called, results in an error as the LocalEnvironmentModel is not registered so far.
In Middleware.cc where all facilities get registered, the LocalEnvironmentModel is missing. What am I doing wrong?

Many thanks and best regards!

@riebl
Copy link
Owner

riebl commented Mar 14, 2019

The environment model is only enabled in the "envmod" configuration of the highway-police scenario, see

[Config envmod]
network = artery.envmod.World
*.traci.mapper.vehicleType = "artery.envmod.Car"

You should be able to run this configuration without modifications.

Side note: This scenario has been created for the chapter about Artery in a soon-to-be-published book "Recent Advances in Network Simulation".

@rtobi
Copy link
Author

rtobi commented Mar 14, 2019

Thanks for your reply!
Maybe I explained myself unclear: The highway-police scenario is running, and the option WITH_ENVMOD is enabled. Just I do not get where the environmental model is used at all, i.e., how I can use its information. Functions from PoliceServiceEnvmod are never called and it does not matter how the services-envmod.xml file looks like (I conclude from that, that it is not used at all).
If I change the PoliceService in services.xml to PoliceServiceEnvmod, then the initialization function is called, but no LocalEnvironmentModel can be found. As far as I understand, there is somewhere a mFacilities.register_const() needed, e.g., in src/artery/application/Middleware.cc, else the call in the initialization function of PoliceServiceEnvmod will fail...

@riebl
Copy link
Owner

riebl commented Mar 14, 2019

artery.envmod.Car is an artery.inet.Car with an additional LocalEnvironmentModel. This model registers itself at the middleware's facilities, see LocalEnvironmentModel::initialize.
I have just run the envmod configuration of highway-police and PoliceServiceEnvmod is working as intended on my system. I have verified this by setting a breakpoint in gdb: break PoliceServiceEnvmod.cc:20 if objects.size() > 0

@rtobi
Copy link
Author

rtobi commented Mar 14, 2019

artery.envmod.Car is an artery.inet.Car with an additional LocalEnvironmentModel. This model registers itself at the middleware's facilities, see LocalEnvironmentModel::initialize.

ok thank you, that seems now to be clear.

I have just run the envmod configuration of highway-police and PoliceServiceEnvmod is working as intended on my system. I have verified this by setting a breakpoint in gdb: break PoliceServiceEnvmod.cc:20 if objects.size() > 0

I tried it with gdb and even with terminal outputs, but both functions are never called. So my question:
What do you mean by running the "envmod configuration of highway-police"? Do I have to set an additional parameter? Probably I missed something there...
I have attached a screenshot of the running example. From my point of view, both local and global environment are not initialized (localEnvironmentModule and globalEnvironmentModule):
highway-police

@riebl
Copy link
Owner

riebl commented Mar 14, 2019

You are not using the envmod configuration. Please select "envmod" from the drop-down box in the dialog shown at OMNeT++ GUI's startup.

@rtobi
Copy link
Author

rtobi commented Mar 15, 2019

Many thanks @riebl for your fast support. Problem solved.
As I would like to work more with artery, is there a dedicated channel to discuss ongoing development, e.g., IRC?

@riebl
Copy link
Owner

riebl commented Mar 17, 2019

@rtobi Feel free join https://gitter.im/omnetpp for this purpose.

@riebl riebl closed this as completed Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants