Demo Version 1
No preview image
Model was written in NetLogo 5.2.0
•
Viewed 318 times
•
Downloaded 32 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
;;;;;;;;;;;;;;;;;;; ;; Global Info ;; ;;;;;;;;;;;;;;;;;;; ;; global variables are either declared here on in the interface (but not both) ;; if added to the interface, global variables are converted to comments ;; this maintains the description of the variable here globals [ ;; control variables clock ;; tracks in minutes the simulation duration ;;sim-runs ;; number of times to run scenario sim-run ;; number of scenarios run ;;sim-type ;; false for legacy scenario, true for FUWS scenario ;;Environment FieldSize ;; used to control distances in the world ;; FUWS ;;Minelines ;; used in the layout/planning of legacy minefields ;;MineQty ;; number of mines in a legacy scenario ;;MobileWeaponQty ;; number of weapons in a FUWS scenario ;; communicator parameters s-comms-range ;; range of undersea comms between sensors w-comms-range ;; range of undersea comms from sensors to weapons ;; threat parameters ;;t-number ;; number of enemy vessels per scenario t-number-list ;; list of the t-numbers t-count ;; number of enemy vessels generated in a scenario t-goal ;; the patch to which the enemy vessles are transisting t-yline ;; the line used to transit the minefield ;;t-speed ;; speed of enemy vessel ;;t-tactic ;; used to select the enemy vessel tactic ;; measures of effectiveness fails ;; Used to count weapon system failures (threat transit success) kills ;; Used to count threat kills by transitor sequence ExpectedCasualties ;; This is used to track the mean number of casualties in a sim-run missed ;; Counts weapons launched that failed to acquire a target Threat1 ;; This is used to calculate the simple initial threat point estimate Threat1SE ;; This is used to calculate the standard error of the simple initial threat point estimate ThreatN ;; This is used to calculate the threat number PkDegradation ;; This may be used to calculate how the risk decays FieldConfigDegradation ;; This may be used to calculate how the minefield decays FieldConfigCost ;; This may be used to report the cost of a COA ] ;;;;;;;;;;;;;; ;; Agents ;; ;;;;;;;;;;;;;; ;; this section describes the agent classes (breeds) ;; and the variables assigned to each member of the agent class ;; this maintains the description of the variable here ;; comments are used to describe the purpose & use of each variable ;; FUWS architecture components breed [ sensors sensor ] ;; FUWS sensors sensors-own [ s-detect s-line s-sensitivity] ;; s-detect is used to control the state of the sensor (1 = threat detected, 0 = no threat detected) ;; s-line is used to assign sensors to a mine-line (integer) ;; s-sensitivity is used to calculate probability of detection based on the reference target breed [ weapons weapon ] ;; FUWS weapons weapons-own [ w-exploder w-line w-tnt w-patrolspeed w-interceptspeed w-priority w-energy] ;; w-exploder is used to control the state of the warhead (1 = detonation ordered, 0 no detonation ordered) ;; w-line is used to assign mines to a mine-line or to a UUV battery of weapons (integer) ;; w-tnt is used to assign the explosive power of warheads ;; w-patrolspeed sets the speed for a mobile platform (UUV type weapon) ;; w-interceptspeed sets the speed for a torpedo launched at the enemy vessel ;; w-priority determines the firing order directed-link-breed [ commslinks commslink ] ;; FUWS comms nodes link sensors to weapons undirected-link-breed [ SensorNetworkLinks SensorNetworkLink ] ;; FUWS comms nodes link sensors to sensors ;; Targets breed [ targetvessels targetvessel ] ;; Enemy Vessels targetvessels-own [ t-damage ] ;; t-damage is used to control the level of damage to the Enemy Vessel (%) ;; t-class is used to designate target classification ;; t-depth for submerged targets ;; t-vulnerability is used to describe the ;; t-size is used to describe the ;; t-signature is used to scale the target's signature to the reference target ;; Environment patches-own [ e-depth e-svp e-bottomtype e-ambientnoise] ;; environment parameters are not used in this demo ;; future development could extend to include this information ;; in calcualtion of the p(detection) and p(kill) ;;;;;;;;;;;;;;;;;;;; ;; Scenario Logic ;; ;;;;;;;;;;;;;;;;;;;; ;; These procedures are used to initiate and control the action of the actors in the scenario ;;------------------------------------------------------------------------------;; to go ;; this procedure initiates the scenario when directed by the user ;; and defines the scenario sequence ifelse (any? TargetVessels) [ tick (set clock (clock + .1) )] ;; if a target exists, time advances in six second increments [ifelse t-count < t-number [setup-nexttarget] [ ;; if a target doesn't exist, either setup the next target ifelse sim-run = sim-runs [endsim stop] [nextsim] ]] ;; or set up the next scenario unless all runs are complete move-targets ifelse sim-type = "fuws" [ fuws-intercept ] [ explode-in-place ] ;; selects targeting logic consitent with deployed system check-kills check-failure end ;;------------------------------------------------------------------------------;; to fuws-intercept ;; this procedure is one possible model of a fuws interaction ;; determines if a sensor detects the enemy vessel let i 1 ;; local variables used to aim the weapon let j FieldSize / 2 let k 0 ;; local variable to identify the initial detecting sensor let l [ who ] of targetvessels ask targetvessels [ ask sensors in-radius figure-of-merit [set s-detect 1 set color yellow ]] ;; sensors that detect an enemy vessel send a detection signal to sensors in the network ask sensors [ if ( s-detect = 1 ) [set i pxcor set j pycor set k who ask SensorNetworkLink-neighbors [if s-detect = 0 [set s-detect 0.5 set color green ]]]] ask sensors [ if ( s-detect = 0.5 ) [ask SensorNetworkLink-neighbors [if s-detect = 0 [set s-detect 0.5 set color lime ]]]] ask sensors [ if ( s-detect = 0.5 ) [ask SensorNetworkLink-neighbors [if s-detect = 0 [set s-detect 0.5 set color turquoise ]]]] ask sensors [ if ( s-detect = 0.5 ) [ask SensorNetworkLink-neighbors [if s-detect = 0 [set s-detect 0.5 set color sky ]]]] ;; sensors that detect an enemy vessel send a detection signal to sensors in the network ask sensors [ if ( s-detect > 0 ) [ask out-commslink-neighbors [ ask weapons [face sensor k rt (heading - 270) / 4] ;; aims the weapon assumes target course 090 speed 11kts ask weapons with-max [w-priority] [set w-exploder 0.5 set shape "torpedo"]] ]] ask weapons [ if (w-exploder = 0.5) [ ;; warheads with w-exploder 0.5 attempt to intercept the target ask my-in-commslinks [die] if any? targetvessels in-cone .1 180 [set w-exploder 1] if any? targetvessels in-cone .2 90 [set w-exploder 1] if any? targetvessels in-cone 2 45 [face targetvessel first l show "homing"] fd (w-interceptspeed / 300 ) set w-energy ( w-energy - 1 ) ]] ;; moves weapon forward by a distance equal to 6 sec ;; warheads damage enemy vessels within the blast radius ask weapons [ if (w-exploder = 1 ) [ask targetvessels in-radius blast-radius [set color pink set t-damage 1 ]]] ask weapons [ if (w-exploder = 1 ) [ show "boom" die ] ] ;; warheads are removed after they deplete available energy ask weapons [ if w-energy = 0 [ set missed missed + 1 show "weapon shut-down" die] ] ask sensors [set s-detect 0 set color cyan ] end ;;------------------------------------------------------------------------------;; to move-targets ;; this procedure determines how targets in the scenario move ifelse t-tactic = "direct path" [ ask TargetVessels [ facexy (item 0 t-goal) (item 1 t-goal)]] ;; this logic drives directly to the goal point [ ask TargetVessels [ ;; this logic drives to the selected t-yline to cross the minefield ifelse pxcor = item 0 t-goal [facexy (item 0 t-goal) (item 1 t-goal)] [ifelse pycor = t-yline [facexy (item 0 t-goal) t-yline ] [facexy (-4) t-yline ] ] ] ] ask TargetVessels [ fd (t-speed / 300 ) ] ;; moves target forward by a distance equal to 6 sec end ;;------------------------------------------------------------------------------;; to explode-in-place ;; this procedure is used to model a legacy mine interaction ;; determines if a sensor detects the enemy vessel ask targetvessels [ ask sensors in-radius figure-of-merit [set s-detect 1 set color pink ]] ;; sensors that detect an enemy vessel send a denonation signal to the warheads ask sensors [ if ( s-detect = 1 ) [ask in-commslink-neighbors [ set w-exploder 1 set color pink ]]] ;; warheads send damage to enemy vessels within the blast radius ask weapons [ if (w-exploder = 1 ) [ask targetvessels in-radius blast-radius [set color pink set t-damage 1 ]]] ;; warheads are removed after they explode if any? weapons with [w-exploder = 1] [ show "boom!"] ask weapons [ if (w-exploder = 1 ) [ die ] ] end ;;;;;;;;;;;;;;; ;; Outputs ;; ;;;;;;;;;;;;;;; ;; These procedures are used to track and report on MOE's/MOP's ;; Still working on this ;;------------------------------------------------------------------------------;; to check-kills ;; this procedure removes targets that are killed by the minefield ask targetvessels [ if ( t-damage >= 1 ) [ die ]] ifelse (any? TargetVessels) [ ] [ set kills replace-item (t-count - 1) kills (1 + item (t-count - 1) kills) output-moe] end ;;------------------------------------------------------------------------------;; to check-failure ;; this procedure removes targets that the minefield "fails" to kill if any? targetvessels-on patch (FieldSize + 5) (FieldSize / 2) [ set fails replace-item (t-count - 1) fails (1 + item (t-count - 1) fails) output-moe] ask patch (FieldSize + 5) (FieldSize / 2) [ask targetvessels-here [die] ] end ;;------------------------------------------------------------------------------;; to output-moe ;; this proceedure updates each MOE when called ;; will call additional MOE calculations when developed Update-ThreatProfile Update-SIT Update-EC end ;;------------------------------------------------------------------------------;; to Update-ThreatProfile ;; this proceedure updates the threat profile MOE ifelse sim-run = 1 [set ThreatN map [(sim-run - ?) / sim-run] fails] [set ThreatN (map [ precision (?1 / ( ?1 + ?2 )) 3 ] kills fails)] ;; output-print ThreatN ;; prints the Threat Profile end ;;------------------------------------------------------------------------------;; to Update-SIT ;; this proceedure updates the SIT and associated standard error set Threat1 first ThreatN set Threat1SE (1 / sim-run) * SQRT ((1 / sim-run) * first kills * (sim-run - first kills)) end ;;------------------------------------------------------------------------------;; to Update-EC ;; this proceedure updates the EC point estimate let j 0 foreach kills [set j (j + ?)] set ExpectedCasualties j / sim-run end ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Weapon System Setup ;; ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; One of the following proceedures is used to set-up the inital weapon system deployment ;;------------------------------------------------------------------------------;; to setup-weaponsystem if FixedField = True [random-seed 1941] ;;the definition of a random seed will ensure the same minefield is generated each time ifelse sim-type = "fuws" [ setup-fuws ] [ ifelse sim-type ="radial minefield" [ setup-minefield_radialminelines ] [ ifelse sim-type ="vertical minefield" [ setup-minefield_verticalminelines] []]] ;; selects the weapon system setup for use **to to expand options** random-seed new-seed end ;;------------------------------------------------------------------------------;; to setup-fuws ;; this stub procedure would be used to set up a fuws scenario - it may need to call separate procedures to setup sensor and weapon fields create-sensors SensorQty ask sensors [set color cyan set s-detect 0 setxy (1) ( FieldSize / 2 ) ;; moves sensors to left edge of minefield set s-line (remainder who Lines) ;; assigns to sensor line set heading 90] let i 0 ;; local variable used to iterate for each sensorline let j 0 ;; local variable used to determine sensor line axis let k 0 ;; local variable used to offset sensorline from edge repeat Lines [ ;; lays each line of sensors set j (260 + random-float 20 ) set k (Fieldsize * .6 * random-float (i + 1) / Lines) ask sensors [if (s-line = i) [ fd k rt j fd (2 * (random-float (0.45 * FieldSize) ) - (0.45 * FieldSize)) ]] set i ( i + 1 )] ask sensors [ create-SensorNetworkLinks-with other sensors in-radius s-comms-range ] ;;ask SensorNetworkLinks [ hide-link ] create-weapons MobileWeaponQty ask weapons [ set color cyan set w-exploder 0 set w-tnt 1 ;; sets explosive power on scale of 0-1 set w-patrolspeed 0 ;; sets patrol speed in kts set w-interceptspeed 45 ;; sets intercept speed in kts set w-energy 100 ;; energy used at 1-unit per 6 sec at intercept speed set w-priority (remainder who MobileWeaponQty) setxy ( 3 * FieldSize / 4 ) ( FieldSize / 2 ) ;; moves mines to right of minefield set w-line (remainder who UUVQty)] set i 0 ;; local variable used to iterate for each UUV weapon bank repeat UUVQty [ ;; positions each UUV set j (350 + random-float 20 ) set k (random-float (0.45 * FieldSize)) ask weapons [ if (w-line = i) [ set heading j fd (2 * k - (0.45 * FieldSize)) ] ] set i ( i + 1 )] ask sensors [ create-commslinks-to weapons in-radius w-comms-range ] ;;ask commslinks [ hide-link ] end ;;------------------------------------------------------------------------------;; to setup-minefield_radialminelines ;; this procedure is used to setup a legacy minefield with minelines concentrating near the center of the minefield create-weapons MineQty ;; generates ask weapons [ set color cyan setxy ( FieldSize / 2 ) ( FieldSize / 2 ) ;; moves mines to center of minefield hatch-sensors 1] ;; creates a sensor atop each mine ask weapons [ create-commslink-to sensor (who + MineQty) [ tie ] ;; creates a tied link from sensor to mine set w-line (remainder who Lines) ;; assigns each mine to a mineline set heading (w-line * 360 / Lines)] ;; sets direction of offset for the mineline from the center of the minefield ask commslinks [ hide-link ] let i 0 ;; local variable used to iterate for each mineline let j 0 ;; local variable used to determine mineline axis let k 0 ;; local variable used to offset mineline from center repeat Lines [ ;; lays each mineline - other logics for laying the initial minefield could be employed set j (120 + random-float 60 ) ;; radomizes heading of each mineline by adding 120 to 180 to the offset direction set k (random-float (Fieldsize * .1)) ;; randomizes the offset of each mineline from the center between 0 * 10% of the minefield size ask weapons [if (w-line = i) [ fd k rt j ;; moves each mine in the mineline out fd (2 * (random-float (0.4 * FieldSize) ) - (0.4 * FieldSize)) ]] set i ( i + 1 )] end ;;------------------------------------------------------------------------------;; to setup-minefield_verticalminelines ;; this procedure is used to setup a legacy minefield with minelines concentrating near the center of the minefield create-weapons MineQty ;; generates ask weapons [ set color cyan setxy ( 2 ) ( FieldSize / 2 ) ;; moves mines to left edge of minefield hatch-sensors 1 ;; creates a sensor atop each mine set heading 90 set w-line (remainder who Lines)] ask weapons [create-commslink-to sensor (who + MineQty) [ tie ] ] ;; creates a tied link from sensor to mine ask commslinks [ hide-link ] let i 0 ;; local variable used to iterate for each mineline let j 0 ;; local variable used to determine mineline axis let k 0 ;; local variable used to offset mineline from center repeat Lines [ ;; lays each line of mines set j (260 + random-float 20 ) set k (.85 * Fieldsize * random-float (i + 1) / Lines) ask weapons [if (w-line = i) [ fd k rt j fd (2 * (random-float (0.48 * FieldSize) ) - (0.48 * FieldSize)) ]] set i ( i + 1 )] end ;;;;;;;;;;;;;;;;;; ;; Calculations ;; ;;;;;;;;;;;;;;;;;; ;; These procedures are used to calculate and return numbers ;;------------------------------------------------------------------------------;; to-report figure-of-merit ;;this procedure returns the range at which a target is detected ;;this may be a randomized number based on t-signal and s-sensitivity or a fixed number report random-normal 0.2 (0.2 / 8) end ;;------------------------------------------------------------------------------;; to-report blast-radius ;;this procedure returns the range at which a target damage from the warhead is a mission kill ;;this may be a randomized number based on t-vulnerability and w-power or a fixed number ;;we will want to update this logic to support calculating damage as a function of range report random-normal 0.2 (0.2 / 16) end ;;;;;;;;;;;;;;;; ;; Initialize ;; ;;;;;;;;;;;;;;;; ;; These procedures are used to setup and establish the scenario components and geographic layout ;;------------------------------------------------------------------------------;; to setup clear-all reset-simulationvariables ;; these global variables are used to execute the simulation reset-scenariovariables ;; these global variables are not (yet) controlled by the interface and describe the scenario setup-environment ;; establishes the environmet/patches initial conditions setup-weaponsystem setup-nexttarget ;; generates the first target reset-ticks end ;;------------------------------------------------------------------------------;; to reset-scenariovariables ;; initial values for global variables not controlled by the interface are set here ;; simulation variables are used to execute the scenario ;; these values may change in the course of a scenario and can be reset by calling this procedure set FieldSize 20 ;; 20 = 10nm * 10nm area each patch is 1kyd ;; component measures of performance set s-comms-range 4 ;; sets range in kyds betweens comms nodes set w-comms-range 10 ;; sets range in kyds betweens comms nodes ;; threat parameters ;;set t-signal 0.1 ;; enemy vessel signal used to calculate sensor probability of detection ;;set t-vulnerability 1 ;; enemy vessel vulnerability to damage factor set t-goal [ ] end ;;------------------------------------------------------------------------------;; to reset-simulationvariables ;; initial values for global variables not controlled by the interface are set here ;; simulation variables are used to execute the scenario ;; these values may change in the course of a scenario and can be reset by calling this procedure ;; component measures of performance ;; control variables set clock 0 ;; tracks time in min set sim-run 1 ;; counts simulation runs set t-count 0 ;; counts enemy vessels generated set t-yline FieldSize / 2 ;; default shapes set-default-shape weapons "x" ;; mines appear as x's set-default-shape sensors "circle 2" ;; sensors will appears as circles set-default-shape TargetVessels "surf_hostile" ;; measures of effectiveness set fails n-values t-number [ 0 ] ;; records the success=0 or failure=1 of the minefield in each trial set kills n-values t-number [ 0 ] ;; records the success=0 or failure=1 of the minefield in each trial set missed 0 set ExpectedCasualties 0 ;; This is used to track the mean number of casualties in a sim-run set Threat1 0 ;; calculates the threat to the single initial transister (SIT) set Threat1SE 0.5 set ThreatN n-values t-number [ 0 ] ;; creates a list of the threat presented to the nth transiter set PkDegradation 0 ;; available metric set FieldConfigDegradation 0 ;; available metric set FieldConfigCost 0 ;; would support CAIV analysis set t-number-list [ ] ;; creates a list of the transiter number for plotting against the threat let i 1 repeat t-number [set t-number-list lput i t-number-list set i (i + 1)] end ;;------------------------------------------------------------------------------;; to setup-environment ;; sets minefield size - note each patch is 1kyd*1kyd resize-world -5 ( FieldSize + 5 ) -5 (FieldSize + 5 ) ;; to provide for maneuver outside the minefield, sets the size of the world 5kys beyond the minefield in all directions ;; the origin is moved to the south-west corner of the minefield area ask patches [ set pcolor black set e-depth 200 ] ;; this section would be extended to support file based inputs to describe real environments ;; draws minefield boundry crt 1 [set color cyan set pen-mode "down" ] ask turtle 0 [setxy 0 FieldSize setxy FieldSize FieldSize setxy FieldSize 0 setxy 0 0 ] ct ;; places land at top and bottom of screen to visually simulate chokepoint ask patches [ if ( pxcor >= 0 and pxcor < FieldSize and (pycor = -5 or pycor = ( FieldSize + 5 ))) [set pcolor orange set e-depth 0] if ( pxcor >= 2 and pxcor < (FieldSize - 2) and (pycor = -4 or pycor = ( FieldSize + 4 ) )) [set pcolor orange set e-depth 0] if ( pxcor >= 4 and pxcor < (FieldSize - 4) and (pycor = -3 or pycor = ( FieldSize + 3 ) )) [set pcolor orange set e-depth 0] ] ;; sets and marks the target objective set t-goal lput (FieldSize + 5) t-goal set t-goal lput (FieldSize / 2) t-goal ask patch (FieldSize + 5) (FieldSize / 2) [set pcolor 5] end ;;------------------------------------------------------------------------------;; to setup-nexttarget ;; this procedure is used to create a new enemy vessel create-TargetVessels 1 ;; creates initial enemy target, future targets will spawn as specified by the scenario ask TargetVessels [ set color red set size 2 setxy -4 random-ycor pd] ;; sets enemy vessel on west edge of minefield set t-count (t-count + 1 ) ;; incriments target vessles ;; sets the path the target will take through the minefield ;; if edge line is used all targets in a simulation will take the same 1ky wide corridor thru ;; however, the location of the path is randomized between simulations if t-tactic = "center line" [ set t-yline FieldSize / 2 ] if t-tactic = "edge line" [ ask TargetVessels [ ifelse t-count = 1 [set t-yline round (1 + random-float (FieldSize / 4)) ][set t-yline t-yline]]] end ;;------------------------------------------------------------------------------;; to nextsim if (sim-run < sim-runs) [ set sim-run (sim-run + 1) set t-count 0 ct setup-weaponsystem setup-nexttarget go] end ;;------------------------------------------------------------------------------;; to endsim file-open "MFSA_prototype_output.csv" file-write ExpectedCasualties file-write ThreatN file-close-all end
There are 8 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
1.2.2_OV-1_V0.9_05302015.png | png | OV-1 | over 9 years ago, by Robert Patchin | Download |
This model does not have any ancestors.
This model does not have any descendants.