-
Couldn't load subscription status.
- Fork 209
Community based movement model Implementation #18
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
base: master
Are you sure you want to change the base?
Community based movement model Implementation #18
Conversation
Community-based Mobility Model Implementation Beta
To complete probability (pi_l) that a give epoch of node is a local one
Because the warmup is not 0, so the initiating coordinates function is not shown properly. for example nodes in Community A can be in the area of Community B at the beginning of the simulation.
| * the directory "example_settings" to root directory | ||
| * 2.rename the configuration to "default_settings.txt" to replace the original | ||
| * one | ||
| * 3. recompile the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there need to recompile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear akeranen,
What i wrote is the source file .java not just a configuration file. So, you have to recompile the new movement model source file into the project. But there is not any conflicts against previous source code and no any modification in previous source code. I just added the new movement model file and explained how to configure the configuration file to test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The settings file should be written so that it can just be passed as a command line argument, rather than replacing default_settings.txt. And the instructions for replacing the default_settings.txt should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some review notes:
-Is the model published somewhere? If so, please add a reference to the publication in the class javadoc. I think that all non-trivial mobility models in the master should be backed by a peer reviewed publication.
-Don't commit junit binary.
-Should use camelCase consistently.
| */ | ||
|
|
||
| /** | ||
| * CommunityBasedMovement where the coordinates are restricted to rectangle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be on top of the class header, not the package line.
| * the directory "example_settings" to root directory | ||
| * 2.rename the configuration to "default_settings.txt" to replace the original | ||
| * one | ||
| * 3. recompile the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The settings file should be written so that it can just be passed as a command line argument, rather than replacing default_settings.txt. And the instructions for replacing the default_settings.txt should be removed.
|
|
||
|
|
||
| /* Probabilities of local or roaming epoch */ | ||
| public static final String PROBABILITIES_LOCAL_ROAMING = "probabilities_local_roaming"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Static fields that identify settings to be read from the settings file should be identified clearly as such. E.g., add an _S or _SETTING suffix. The javadoc for settings names should include ({@value}) so that it shows up in the compiled javadoc. If the setting has a default value (like the map size, the javadoc of the setting should state what it is). The ONE also uses camelCase in most places, including setting names.
| private int community_x_number = 1, community_y_number = 1; | ||
|
|
||
| /* Community identifier that should be identical to the Group ID in configuration file */ | ||
| private static String[] community_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure about this. It feels like it might be better to have explicit configuration for the home community of each group in the settings file. Or at least an option to do it explicitly.
| double[] community_attribute_coordinates = {community_x_min, community_y_min, | ||
| community_x_max, community_y_max}; | ||
|
|
||
| community_attribute.put(community_id[array_counter++], community_attribute_coordinates); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace array_counter with i * this.community_x_number + j.
| /** | ||
| * Generate a random coordinates in the given community area. | ||
| * @param community_area | ||
| * @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete javadoc.
| * @return Final destination | ||
| */ | ||
| protected Coord local_roaming_selection() { | ||
| if (((rng.nextDouble()) * 100) < (pi_l * 100)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why * 100?
| # | ||
|
|
||
| ## Scenario settings | ||
| Scenario.name = default_scenario |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scenario name should be changed to something else than the default.
Community based movement model Implementation:
Add two source files: CommunityBasedMovement.java and the corresponding configuration file.