Skip to content

Commit

Permalink
758, renamed file, corrected comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillitried committed Feb 26, 2024
1 parent 1b94b6b commit 74041e4
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,24 @@
import org.eclipse.mosaic.fed.cell.config.model.CNetworkProperties;
import org.eclipse.mosaic.fed.cell.config.util.ConfigurationReader;
import org.eclipse.mosaic.lib.geo.GeoPoint;
import org.eclipse.mosaic.lib.geo.GeoPolygon;
import org.eclipse.mosaic.lib.model.delay.GammaRandomDelay;
import org.eclipse.mosaic.rti.api.InternalFederateException;

import com.google.common.base.Charsets;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonWriter;

/**
* Helper that modifies a region.json config file and writes it back to the source file.
* Helper that configures a GammaRandomDelay in a region.json file and writes it back to the source file.
*/
public class RegionsConfigUtility {
public class RegionsConfigGammaDelayUtility {
public static CRegion getRegionsConfig(String regionConfigurationPath) {
CRegion regionConfig = null;
try {
Expand All @@ -58,8 +53,8 @@ public static CRegion getRegionsConfig(String regionConfigurationPath) {
* Sets all transmission delays (uplink, downlink.multicst, downlink.unicast) to 'GammaRandomDelay'.
*
* @param cRegion The region configuration object
* @param minDelay The minimum delay value (ms)
* @param expDelay The expected delay value (ms)
* @param minDelay The minimum delay value (ns)
* @param expDelay The expected delay value (ns)
*/
public static void setGammaRandomDelay(CRegion cRegion, long minDelay, long expDelay) {
GammaRandomDelay delay = new GammaRandomDelay();
Expand Down Expand Up @@ -97,7 +92,7 @@ public static void exportRegionsConfig(String regionConfigurationPath, CRegion c

public static void main(String[] args) {
if (args.length != 3) {
System.out.println("Usage: RegionsConfigUtility <path-to-regions.json> <minDelay> <expDelay>");
System.out.println("Usage: RegionsConfigUtility <path-to-regions.json> <minDelay (ns)> <expDelay (ns)>");
}

String regionConfigurationPath = args[0];
Expand Down

0 comments on commit 74041e4

Please sign in to comment.