diff --git a/src/wpsremote/xmpp_data/test/CMREOAA_MainConfigFile_template.json b/src/wpsremote/xmpp_data/test/CMREOAA_MainConfigFile_template.json new file mode 100644 index 0000000..33dd7cb --- /dev/null +++ b/src/wpsremote/xmpp_data/test/CMREOAA_MainConfigFile_template.json @@ -0,0 +1,134 @@ +{ + "Config": { + "randomSeed": 0.345597888, + "evaluatorAMGA2": "evaluateAMGA2", + "latLim": [ + 0, + 20 + ], + "lonLim": [ + 50, + 70 + ], + "debugMode": 0, + "acceptanceThreshold": -1, + "pathFilename": "tracks.csv", + "postprocessorAMGA2": "postprocessAMGA2", + "nConstr": 0, + "waypointFilename": "waypoints.csv", + "eliteSize": 50, + "costName": [ + "Average R_w", + "Average Area Coverage", + "Total Cost" + ], + "loadStructInstrList": [ + { + "name": "riskStruct", + "nanValue": 9999, + "source": "InputData/PAGMaps/", + "reader": "geotiff", + "type": "dynamicgrid", + "FieldValue": { + "isTimeDependent": 1 + } + }, + { + "reader": "coast", + "type": "staticconstraint", + "FieldValue": { + "allowInside": 0, + "isTimeDependent": 0, + "hard": 1, + "name": "coastline" + }, + "name": "staticConstraint" + }, + { + "type": "staticconstraint", + "name": "staticConstraint", + "FieldValue": { + "name": "bbox", + "hard": 1, + "lon": [ + 50, + 70, + 70, + 50, + 50 + ], + "lat": [ + 20, + 20, + 0, + 0, + 20 + ], + "isTimeDependent": 0, + "allowInside": 1 + } + }, + { + "source": "/tmp/", + "type": "asset", + "name": "Asset", + "reader": "json" + } + ], + "proj": { + "projVarList": [ + [ + "x", + "y" + ], + [ + "xLim", + "yLim" + ], + [ + "xV", + "yV" + ], + [ + "x0", + "y0" + ] + ], + "geoVarList": [ + [ + "lat", + "lon" + ], + [ + "latLim", + "lonLim" + ], + [ + "latV", + "lonV" + ], + [ + "lat0", + "lon0" + ] + ] + }, + "paretoFile": "pareto_AMGA2.dat", + "decoderAMGA2": "decodeAMGA2_hs", + "optimizer": "optimizeAMGA2", + "stopSurveillanceAtLastWP": 0, + "showEachXeval": { + "X": 10, + "t_start": 0 + }, + "preprocessorAMGA2": "preprocessAMGA2_hs", + "nEvaluations": 0, + "extSolFilename": "", + "waypointSamplingPeriod": 10800, + "refDate": "2014-08-01T00:00:00Z", + "downSamplingAssetTrajectoryRate": 3, + "timeHorizon": 0, + "costFilename": "costs.csv", + "pathSamplingPeriod": 1800 + } +} \ No newline at end of file diff --git a/src/wpsremote/xmpp_data/test/OAAonDemandWrapper_template.properties.txt b/src/wpsremote/xmpp_data/test/OAAonDemandWrapper_template.properties.txt new file mode 100644 index 0000000..6215a83 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/OAAonDemandWrapper_template.properties.txt @@ -0,0 +1,43 @@ +[DEFAULT] + + +class_name = oaaWrapper.OAAWrapper + +runname=OAAIndianOceanNOAAWW3 + +root_working_dir={{workdir}}\ +daily_working_dir = %(root_working_dir)s + +executable=foo/executable.exe + +#if main_config_dir is empty files are already present in %(root_working_dir)s +main_config_dir= +config_file = config.json +config_file_path = %(root_working_dir)s%(config_file)s + + +retrive_init_position_up_to_days_ago = 3 + +oaa_cmd = %(executable)s %(daily_working_dir)s%(config_file)s + +input_data_dir = %(daily_working_dir)sInputData\PAGMaps\ + +tracks_file = tracks.csv +output_tracks_file = %(daily_working_dir)s%(tracks_file)s + +waypoints_file = waypoints.csv +output_waypoints_file = %(daily_working_dir)s%(waypoints_file)s + +costs_file = costs.csv +output_costs_file = %(daily_working_dir)s%(costs_file)s + +tracks_file_filtered = tracks_filtered.csv +output_tracks_file_filtered = %(daily_working_dir)s%(tracks_file_filtered)s + + +cost_weight= + +set_asset_initial_position_from_previous_runs=False + + + diff --git a/src/wpsremote/xmpp_data/test/asset_schema.json b/src/wpsremote/xmpp_data/test/asset_schema.json new file mode 100644 index 0000000..0b59c44 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/asset_schema.json @@ -0,0 +1,52 @@ +{ + "Asset": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "minimum": 0, + "maximum": 10, + "exclusiveMaximum": false + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "minSpeed": { + "type": "number" + }, + "maxSpeed": { + "type": "number" + }, + "maxHeading": { + "type": "number" + }, + "minHeading": { + "type": "number" + }, + "lat0": { + "type": "number" + }, + "lon0": { + "type": "number" + }, + "heading0": { + "type": "number" + }, + "cost": { + "type": "number" + }, + "obsRange": { + "type": "number" + }, + "Pd": { + "type": "number" + }, + "Pfa": { + "type": "number" + } + } + } +} \ No newline at end of file diff --git a/src/wpsremote/xmpp_data/test/geoserverCommands_template.properties.txt b/src/wpsremote/xmpp_data/test/geoserverCommands_template.properties.txt new file mode 100644 index 0000000..5d58377 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/geoserverCommands_template.properties.txt @@ -0,0 +1,21 @@ +[DEFAULT] + +class_name = geoserverCommands.GeoserverCommands + +workdir = {{workdir}}\ + +waypoint_file_name = waypoints.csv +tracks_file_name = tracks_filtered.csv +costs_file_name = costs.csv + +geoserver_xml_template_filepath = geoserverLoadOAAOutput.xml +geoserver_xml_output_filepath = {{workdir}}\geoserverLoadOAAOutput.xml + +unique_id = c5b4e49463e3f6cc52b20cad84b916a5_6372f7586782d53aac853e492c77aa55 +geoserver_layers_namespace = remotewps_oaa + +geoserver_tracks_layer_name = oaa_tracks_%(unique_id)s.csv +tracks_outfile_url = file:/storage/remoteWPS_data/AssetAllocatorOnDemand/runs/%(unique_id)s/%(geoserver_tracks_layer_name)s + +geoserver_waypoint_layer_name = oaa_waypoint_%(unique_id)s.csv +waypoint_outfile_url = file:/storage/remoteWPS_data/AssetAllocatorOnDemand/runs/%(unique_id)s/%(geoserver_waypoint_layer_name)s \ No newline at end of file diff --git a/src/wpsremote/xmpp_data/test/oaaOnDemand_template.properties.txt b/src/wpsremote/xmpp_data/test/oaaOnDemand_template.properties.txt new file mode 100644 index 0000000..d972e83 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/oaaOnDemand_template.properties.txt @@ -0,0 +1,9 @@ +[DEFAULT] + +extract=wcsOAAonDemand.properties + +transform = OAAonDemandWrapper.properties + +load_1 = GeoserverCommands.properties + +durations = [10,80,10] \ No newline at end of file diff --git a/src/wpsremote/xmpp_data/test/service.config b/src/wpsremote/xmpp_data/test/service.config new file mode 100644 index 0000000..c1e7e76 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/service.config @@ -0,0 +1,147 @@ +# This is a inni file to be read with python ConfigParser (https://docs.python.org/2/library/configparser.html) +# Is possible to reference another variable in the ini file using the format %()s + +[DEFAULT] +service = Service +namespace = default +description = foo service +executable_path = \code\etl +executable_cmd = python %(executable_path)s\etl.py +output_dir = \tmp\oaaOnDemand +unique_execution_id = %(unique_exe_id)s +workdir = %(output_dir)s\%(unique_execution_id)s +active = True +max_running_time_seconds = 300 + + +[Input1] +class = param +name = referenceDate +type = string +description = Start date of optmizier + +[Action1] +class = cmdline +input_ref = referenceDate +alias = d +template = -name value + +[Input2] +class = param +name = numberOfEvaluations +type = int +description = Number of optimizer iterations + +[Action2] +class = updateJSONfile +input_ref = numberOfEvaluations +source_filepath = .\configs\OAAonDemand\CMREOAA_MainConfigFile_template.json +target_filepath = %(workdir)s\config.json +json_path_expr = ['Config']['nEvaluations'] + +[Input3] +class = param +name = timeHorizon +type = int +description = Optimizer time horizon in seconds + +[Action3] +class = updateJSONfile +input_ref = timeHorizon +source_filepath = .\configs\OAAonDemand\CMREOAA_MainConfigFile_template.json +target_filepath = %(workdir)s\config.json +json_path_expr = ['Config']['timeHorizon'] + + +[Input4] +class = param +name = asset +type = application/json +description = Assets configuration +min = 1 +max = 10 + +[Action4] +class = createJSONfile +input_ref = asset +target_filepath = %(workdir)s\asset_${json_path_expr}.json +json_path_expr = ['Asset']['id'] +json_schema = .\configs\OAAonDemand\asset_schema.json + + +[Const1] +class = const +name = workdir +type = string +description = Optimal Asset Allocator process sandbox working directory +value = %(workdir)s + +[Action5] +class = cmdline +input_ref = workdir +alias = w +template = -name value + + +[Const2] +class = const +name = etlExecutionType +type = string +description = identifies the type of execution performed by etl.py script +value = oaaOnDemand + +[Action6] +class = cmdline +input_ref = etlExecutionType +template = value + + +[Action7] +class = copyfile +source_filepath = .\configs\OAAonDemand\oaaOnDemand_template.properties +target_filepath= %(workdir)s\oaaOnDemand.properties + + +[Action8] +class = updateINIfile +input_ref = timeHorizon +source_filepath = .\configs\OAAonDemand\wcsOAAonDemand_template.properties +target_filepath= %(workdir)s\wcsOAAonDemand.properties +section = DEFAULT +alias = time_horizont_sec + +[Action9] +class = copyfile +source_filepath = .\configs\OAAonDemand\OAAonDemandWrapper_template.properties +target_filepath= %(workdir)s\OAAonDemandWrapper.properties + + +[Const3] +class = const +name = uniqueId +type = string +description = unique id identifing the run +value = %(unique_execution_id)s + +[Action10] +class = updateINIfile +input_ref = uniqueId +source_filepath = .\configs\OAAonDemand\geoserverCommands_template.properties +target_filepath= %(workdir)s\geoserverCommands.properties +section = DEFAULT +alias = unique_id + + +[Output] +name = result +type = string +description = xml OAA output file +filepath = %(workdir)s\geoserverLoadOAAOutput.xml + + + + +[Logging] +#note the order +stdout_parser = [.*\[DEBUG\](.*), .*\[INFO\] ProgressInfo\:([-+]?[0-9]*\.?[0-9]*)\%, .*\[(INFO)\](.*), .*\[(WARN)\](.*), .*\[(ERROR)\](.*), .*\[(CRITICAL)\](.*)] +stdout_action = [ignore, progress, log, log, log, abort] diff --git a/src/wpsremote/xmpp_data/test/wcsOAAonDemand_template.properties.txt b/src/wpsremote/xmpp_data/test/wcsOAAonDemand_template.properties.txt new file mode 100644 index 0000000..231d514 --- /dev/null +++ b/src/wpsremote/xmpp_data/test/wcsOAAonDemand_template.properties.txt @@ -0,0 +1,32 @@ +[DEFAULT] + +class_name = wcsQuery.WCSQuery + +geoserver_address = http://localhost:8080 + +geoserver_URL= %(geoserver_address)s/geoserver/wcs +geoserver_rest_url= %(geoserver_address)s/geoserver/rest/ +geoserver_user=admin +geoserver_password=****** + +output_crs=4326 +request_crs=4326 + + +minlongitude=50 +maxlongitude=70 +minlatitude=0 +maxlatitude=20 + +layer_list=[PAGM] +out_filename_prefix=[ PAG ] + + +outdir = {{workdir}}\inputData\PAGMaps\ + +workspace = [TDA] +single_run_mode = False +time_horizont_sec = 259200 +cleanup_download_dir=*.* + +