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.
Why is there need to recompile?
There was a problem hiding this comment.
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.
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.
tk721
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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 |
| * @return Final destination | ||
| */ | ||
| protected Coord local_roaming_selection() { | ||
| if (((rng.nextDouble()) * 100) < (pi_l * 100)) { |
| # | ||
|
|
||
| ## Scenario settings | ||
| Scenario.name = default_scenario |
There was a problem hiding this comment.
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.