UBoats in the Bay of Biscay
Model was written in NetLogo 6.1.1
•
Viewed 343 times
•
Downloaded 38 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
Click to Run Model
; Developed by Ken Comer to evaluate kinematic activity in the Bay of Biscay breed [uboats uboat] ; There is only one kind of U-boat uboats-own [dest speed submerged? status dived? battery transittime lastescape] breed [s25s s25] s25s-own [fuel speed nearest patrol? outbound? pathrs contacts] globals [Brest LOrient SaintNazere Plymouth LaRochelle Bordeaux deployed encounters totalpatrolhrs opportunities escapes ttimes s25-arrate ports ocean] patches-own [ region ; the number of the region that the patch is in, patches outside all regions have region = 0 ] To Setup __clear-all-and-reset-ticks import-pcolors "Bay_of_Biscay_Short.bmp" set Brest patch 418 316 set LOrient patch 434 280 set SaintNazere patch 471 256 set LaRochelle patch 546 201 set Bordeaux patch 560 171 set Plymouth patch 435 440 set-default-shape uboats "suboat" set-default-shape s25s "airplane 2" set ports (list Brest lorient saintnazere larochelle bordeaux) set ocean patches with [pcolor = 9.9] set deployed 0 set encounters 0 ; The number of minute-turns in which a surfaced U-boat is in cone of an S25 set totalpatrolhrs 0 set opportunities 0 ; The number of minute-turns in which a U-boat (surfaced or dived) is in cone of an S25 set escapes 0 set ttimes [] set s25-arrate ph-generator / 4000 * 0.013 ; the s.25 arrival rate from slider End ; setup To Go ; ask agents Move if ticks < 2 [StartUboat] if random-float 1 < 0.0013 [StartUboat] if random-float 1 < s25-arrate [StartS25] ; gives about 4K TPH ask turtles [move] ask s25s [search] ; Search after you turn, submarines set status, check fuel Tick if ticks = 43204 [stop] ; Each run lasts 30 days End ;go To StartUBoat ; This procedure creates a U-boat at one of the ports and sends it west. create-uboats 1 [ set size 10 set speed 10 ; Uboats transit from the coast at 10 kts. move-to one-of ports ; Randomly start at one of the ports. set heading 275 + random 35 ; Fan out randomly. set dived? FALSE ; Surfaced transit. set status "egress" ; Ensures it doesn't dive during egress set transittime 0 ; I'm going to determine total minutes to transit set lastescape 0 ; Used to avoid double-counting escapes. ] End ; Create Uboat To StartS25 create-S25s 1 [ set size 20 move-to Plymouth set heading 200 + random 50 set fuel 100 set label-color 10 set patrol? FALSE ; Used to measure TPH and limit search subroutine set outbound? TRUE ; Used to transition to patrol on outbound leg set pathrs 0 set contacts [] ] End ; StartS25 To Move ;Actual movement in the main command. This depletes fuel and battery. if (breed = uboats) [ fd speed / 60 set transittime transittime + 1 if-else dived? [ ; Consume battery for submerged submarines set battery battery - .25 ; Battery life 5.2 hrs if battery < 20 [surface] ; Battery too low to stay down ] [ ; Charge battery for surfaced submarines if battery < 100 [set battery battery + .3] ; Recharge in 4.33 hrs if maxsubmergence? [ if battery > 98 [submerge] ; battery full, dive in Max Submgnce ] ] ; if-else dived? checkPosition ; Transition egress to transit or transit to done ] ; ask uboats ; Now for the s25s if (breed = s25s) [ fd airspeed / 60 set fuel fuel - 0.12 ; Gives 10.4 hours operational flight before RTB if-else labels? [set label round pathrs] ; For visual debugging [set label ""] checkStatus ; Transition to patrol, Maneuver in the box, check fuel, Land ] End ; move to CheckPosition ;Uboats look at what its doing if xcor < 370 [ ; Check to see if I'm in the op area if status = "egress" [ ; if I just entered the op area... submerge ; dive and chamge my status to transit set status "transit" ] ; a transiting, non-dived uboat ] if xcor < 100 or ycor > 520 [ ; If I've reached the North Atlantic... set deployed deployed + 1 ; Add me to the tally of deployed Uboats set ttimes lput transittime ttimes die ; And remove me from the model ] end ; CheckPosition for Uboats to CheckStatus ;After S25 moves, check to see if they need to change something if outbound? [ if xcor < 340 [ set patrol? TRUE set outbound? FALSE set heading 235 ] ] if patrol? [ if xcor > 360 [ ; Eastern boundary, head West set heading 225 + random 90 ] if xcor < 190 [ ; Western boundary, head East set heading 45 + random 90 ] if ycor < 200 [ ; Southern boundary, head North set heading 295 + random 90 ] if ycor > 430 [ ; Northern boundary, head South set heading 135 + random 90 ] if fuel < 25 [face Plymouth set patrol? FALSE ] ; RTB Out of gas set pathrs pathrs + 1 / 60 ] ; end of "if on patrol block" if ycor > 444 ;arrived at Plymouth [set totalpatrolhrs totalpatrolhrs + pathrs die] end ; S25 status to search ; Executed by every S25 every turn. if not patrol? [stop] ; non-patrolling aircraft should not be searching if count uboats < 1 [stop] ; No use searching an empty ocean. let target-set uboats in-cone S25-vision cone-angle ; Creates the set of all uboats in my cone if count target-set > 0 [ ; There's a Uboat in the cone let target min-one-of (uboats) [distance myself] ; Don't look for closest unless there's one in the cone. set nearest distance target if (member? target target-set) [ ; True if target is in my cone, false if nearest uboat is outside cone ; user-message(word "Target is in the cone. Who is: " who) set opportunities opportunities + 1 ; Count number of turns a U-boat is in the cone of an S25 ask target [ if-else not dived? [ ; user-message(word "Uboat in cone of: " who "and surfaced. Battery: " round battery) if dived? [user-message("I am submerged!")] if random-float 1 < 0.1 [ ; S25s attack only 10% of what they CAN see (surfaced, in their cone) per turn. ask myself [attack] ] set encounters encounters + 1 ; I count all encounters S25 to surfaced U-bot per turn, not all attacks. ; Note the above statment may count multiple encounters for the same interaction. ] ; end if target is surfaced, now else (target is dived in the cone) [ ; Target is selected but is dived, so... if (ticks - 1) > lastescape [ ; This target was NOT escaping last run. This UBoat skipped a turn in this loop. ; Note: this if condition means escapes are counted only once while opportunities & encounters happen every min. set escapes escapes + 1] ; Counts the number a submerged U-boats pass under an S25 detection cone (overall, not per min) set lastescape ticks ; Links this minute to the next in case I'm still in the cone. ]; target was dived ] ; stop asking target to do things ] ; Closest uboat in the cone selected. ] ; There's a uboat in the cone ask uboats in-cone uboatvision 360 [ ; Finds Uboats that can see me out to their vision. if not dived? [ ; user-message(word "Uboat crash dives. Battery: " round battery) submerge ; and asks them to dive if they are not dived already. ] ; This allows half to escape ] end ; search to submerge set shape "uuboat" set speed 2 set dived? TRUE ; let attacker min-one-of (s25s) [distance myself] ;these report distance to nearest Sunderland ; let disttoS25 distance attacker ; ; user-message(word "Uboad dived, plane is nm: " disttos25) end ; to snort set shape "uboat" set speed 5 set dived? FALSE end to surface set shape "suboat" set speed UT-speed set dived? FALSE end to attack watch-me ; wait 15 set shape "attacking" set patrol? FALSE face plymouth end ; attack ; to-report intvalue [x] ; set x round x ; report x ; end
There are 2 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Bay_of_Biscay_Short.bmp | background | This is the background map called for in the code. It should be in the model's directory. | over 4 years ago, by Ken Comer | Download |
UBoats in the Bay of Biscay.png | preview | Preview for 'UBoats in the Bay of Biscay' | over 4 years ago, by Ken Comer | Download |
This model does not have any ancestors.
This model does not have any descendants.
Ken Comer
Background and Information
This is a “baseline” ABM of the Allied campaign to interdict Nazi U-boats as they sortied from the five ports in occupied France to the North Atlantic. It can be adapted to answer any of a large number of questions regarding search theory, especially the many-on-many search for a population of evasive targets. This creates, in NETLOGO, a computational approach to a problem that had been evaluated using mathematical search theory and game theory.
Posted over 4 years ago
Ken Comer
Historical Context
The Battle of the Bay of Biscay began in late 1940 and lasted until early 1944. Activity did not begin in earnest until late 1941, and data only becomes available in January 1942. By the spring of 1944 the British had nearly complete dominance of the approaches to the French coast. Submarine deployments after that point were limited to small numbers and transits nearly stopped completely after D-Day (June 1944). This model was built around the high-tempo operations of 1942 and 1943. It was a battle between the German submarine force and the Royal Air Force. For the most part these were German Type VIIC submarines and British Short Sunderland (S.25) four-engine ASW aircraft. The British were based in Plymouth and the Germans were evenly spread among the five U-boat bases. U-boats in port were protected by thick concrete “pens” that are so indestructible that they remain in these five ports to this day. The only way to counter a U-Boat was to sink it at sea. The German mission was to move the U-boats to the North Atlantic where they would attack convoys. The UK mission was to sink as many transiting U-boats as possible, and to delay the others. British operations research co-founder Arthur Waddington referred to the British goal as the creation of an “unclimable fence”. The fence would be so wide that a U-boat could not traverse it completely submerged. This years-long operation was seen by both sides as critical to victory. Winston Churchill famously said, “The only thing that ever really frightened me during the war was the U-Boat peril.”
Posted over 4 years ago
Tom Lindeboom
Unfortunally not working
import-pcolors: /mnt/b8129935-5500-41ca-a219-329ea630ef31/NetLogo 6.1.1/Ken_Comer/UBoats_in_the_Bay_of_Biscay/Bay_of_Biscay_Short.bmp (Bestand of map bestaat niet) error while observer running IMPORT-PCOLORS called by procedure SETUP called by Button 'Setup' Regards, Tom
Posted over 4 years ago
Ken Comer
Map file Bay_of_Biscay_Short.bmp has been added.
The error is generated when the model calls the background map. If this is in the path, the model should run. Let me know...
Posted over 4 years ago
Tom Lindeboom
Bay_of_Biscay_Short.bmp
The BMP file was corrupted on both Mac Probook and Windows 10. I've managed to repair it and now it works fine. A nice model.
Posted over 2 years ago