Operation Barbarossa

Operation Barbarossa preview image

1 collaborator

Default-person Josiah Evans (Author)

Tags

(This model has yet to be categorized with any tags)
Part of project 'Operation Barbarossa'
Model group MAM-2016 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0-M5 • Viewed 714 times • Downloaded 54 times • Run 0 times
Download the 'Operation Barbarossa' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

This model attempts to explore the effects of weather and terrain on the progression of Operation Barbarossa and Operation Typhoon, two major offensives that were crucial in determining the outcome of world war 2.

HOW IT WORKS

Each patch represents an area of terrain and each turtle represents a division. Grey turtles attack and take red territory, and red turtles defend and take grey territory. Weather is also simulated which effects the fighting capabilities of each side differently.

HOW TO USE IT

You can adjust the effects of weather and terrain by adjusting their sliders, higher values mean they have more of an impact during battles. The reinforcement rates for each side can also be adjusted to change how frequently and by how much each side is reinforced.

THINGS TO NOTICE

Notice the slowdown once the temperature drops below 10 degrees celcius, as battles take longer to resolve.

THINGS TO TRY

Try running the model with no terrain or weather effects to see what the Germans expected to happen, and then crank them up to see how important they are when thinking about how easily it really was.

EXTENDING THE MODEL

Try finding more accurate historical data to improve the battle simulation, or a levelspace simlulation of each battle at the regimental level. Also try to find the historical rate for reinforcement for each side.

NETLOGO FEATURES

This model does not use any unusual features of Netlogo

RELATED MODELS

This is the first model I have seen which attemtps to model a military campaign.

CREDITS AND REFERENCES

Check out this model and many others at http://modelingcommons.org/browse/onemodel/4652#modeltabsbrowsenlw

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

breed[divisions division]
patches-own[terrain water]
divisions-own[nation tech reliability manpower maxmanpower organization maxOrganization recovering]
globals [temperature nazi-deaths soviet-deaths precipitation]

;; Setup Functions

to setup
  clear-all
  set-default-shape divisions "square"
  set temperature 16.1
  set nazi-deaths 0
  set soviet-deaths 0
  set precipitation 0
  setup-patches
  setup-soviets
  place-soviets
  setup-nazis
  place-nazis
  reset-ticks
end 

to setup-nazis
  ;;49 divisions in total for army group center
  create-divisions 49 [setup-nazi-division]
end 

to setup-soviets
  ;;45 divisions in total for western front
  create-divisions 45 [setup-soviet-division]
end 

to setup-soviet-division

  set heading 270
  set color red + 3
  set manpower (random 4000) + 8000
  set maxmanpower manpower
  set tech random 30
  set reliability 10
  set organization (random 30) + 15
  set maxOrganization organization
  set nation "soviet"
  set recovering false
end 

to place-soviet-division
  set xcor random 3 - 20
  set ycor random 20 - 10
end 

to place-soviets
  ask divisions with [nation = "soviet"] [
   place-soviet-division
  ]
end 

to setup-nazi-division
  set heading 90
  set color grey + 3
  set manpower (random 2000) + 10000
  set maxmanpower manpower
  set tech (random 30) + 10
  set reliability 20
  set organization (random 30) + 30
  set maxOrganization organization
  set nation "nazi"
  set recovering false
end 

to place-nazi-division
  set xcor random 3 - 23
  set ycor random 20 - 10
end 

to place-nazis
  ask divisions with [nation = "nazi"] [
   place-nazi-division
  ]
end 

to setup-patches
  ask patches[
    set water 0
    setup-patch]
end 

to setup-patch
  ;;for now just set them all to 0
  set terrain (1 / 10 * pxcor) - ((random 2) - 1)
  ifelse pxcor < -20 [set pcolor grey + terrain]
  [set pcolor red + terrain]
end 












;; Simulation functions

to go
  set temperature (11.05 * (cos ticks) + 7.05)
  set temperature temperature + random-float 12 - 6
  ifelse temperature > 20 [set precipitation .7]
  [ifelse temperature > 15 [set precipitation .3]
    [ifelse temperature > 5 [set precipitation .6]
    [set precipitation .2]]]
  if ticks > 180 [stop]
  move-nazi-divisions
  move-soviet-divisions
  ask divisions [
   set organization organization + 1
   set manpower manpower + 100
   if manpower >= maxmanpower [set manpower maxmanpower]
  ]
  if remainder ticks soviet-rate = 0 [reinforce-soviets]
  if remainder ticks nazi-rate = 0 [reinforce-nazis]
  ask patches [simulate-rain]
  diffuse water .2
  tick
end 

to move-soviet-division
  ifelse (not any? (divisions-on [neighbors] of patch-here) with [nation = "nazi"])[
    ifelse any? ([neighbors] of patch-here) with [shade-of? grey pcolor][
      move-to one-of ([neighbors] of patch-here) with [shade-of? grey pcolor]
      ask patch-here [set pcolor red + terrain]
      ]
    [
      ifelse can-move? 1 [fd 1]
      [move-to one-of [neighbors] of patch-here]
      ]
    ]
  []
end 

to move-soviet-divisions
  ask divisions with [nation = "soviet"] [
   ifelse not recovering [
     move-soviet-division
   ]
    [if organization >= maxOrganization [
        set organization maxOrganization
        set recovering false]]
  ]
end 

to move-nazi-division
  ifelse any? ((divisions-on ([neighbors4] of patch-here)) with [nation = "soviet"]) [
    ifelse organization < 0 or recovering []
    [battle one-of other (divisions-on ([neighbors4] of patch-here)) with [nation = "soviet"]]
  ]
  [ifelse any? ([neighbors] of patch-here) with [shade-of? red pcolor] [
    move-to one-of ([neighbors] of patch-here) with [shade-of? red pcolor]
    ask patch-here [set pcolor grey + terrain]]
  [ifelse can-move? 1 [
      fd 1][
      move-to one-of [neighbors] of patch-here]]]
end 

to move-nazi-divisions
  ask divisions with [nation = "nazi"] [
    ifelse not recovering [
      if [water] of patch-here < 1 [
        move-nazi-division
      ]
    ]
    [if organization >= maxOrganization [
        set organization maxOrganization
        set recovering false]]
  ]
end 

to battle [#enemy]
  ;;Our attack

  ask #enemy [
    let attack-strength random (([tech] of myself) + .1 * [manpower] of myself)
    set attack-strength attack-strength - ([terrain] of patch-here) * 20 * terrain-scale

    let reliability-modifier [temperature / reliability] of myself
    if reliability-modifier > 1 [set reliability-modifier 1]
    if reliability-modifier < 0 [set reliability-modifier .1]
    set attack-strength attack-strength * reliability-modifier

    if attack-strength < 0 [set attack-strength 0]
    set manpower manpower - attack-strength

    ifelse [nation = "nazi"] of myself
    [set soviet-deaths soviet-deaths + attack-strength]
    [set nazi-deaths nazi-deaths + attack-strength]

    set organization organization - random-float .01 * attack-strength
    if organization <= 0
    [
     set organization 0
     set recovering true
     fd -4
    ]
    if manpower < 0 [
      set manpower 0
      die
    ]
  ]

  if #enemy != nobody [

  ;;Enemy counter-attack
  let attack-strength random (([tech] of #enemy) + .1 * [manpower] of #enemy)
  set attack-strength attack-strength - ([terrain] of patch-here) * 20 * terrain-scale

  let reliability-modifier [temperature / reliability] of #enemy
  if reliability-modifier > 1 [set reliability-modifier 1]
  if reliability-modifier < 0 [set reliability-modifier .1]
  set attack-strength attack-strength * reliability-modifier

  if attack-strength < 0 [set attack-strength 0]
  set manpower manpower - attack-strength
  ifelse nation = "nazi"
  [set nazi-deaths nazi-deaths + attack-strength]
  [set soviet-deaths soviet-deaths + attack-strength]
  set organization organization - random-float .01 * attack-strength
    if organization <= 0 [
      set organization 0
      set recovering true
      fd -4
    ]
    if manpower < 0 [
      set manpower 0
      die
    ]]
end 

to reinforce-soviets
  if any? patches with [shade-of? red pcolor and pxcor > 25][
    create-divisions soviet-reinforcements [
      setup-soviet-division
      move-to one-of patches with [shade-of? red pcolor and pxcor > 25]]]
end 

to reinforce-nazis
  if any? patches with [shade-of? grey pcolor and pxcor < -23][
    create-divisions nazi-reinforcements [
      setup-nazi-division
      move-to one-of patches with [shade-of? grey pcolor and pxcor < -23]]]
end 

to simulate-rain
  if random-float 1 < precipitation [
   set water water + random 4
  ]
  set water water - 1
  if water < 0 [set water 0]
end 

There are 3 versions of this model.

Uploaded by When Description Download
Josiah Evans over 8 years ago Added Info tab Download this version
Josiah Evans over 8 years ago Implemented dynamic weather and precipitation Download this version
Josiah Evans over 8 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Operation Barbarossa.png preview fda over 8 years ago, by Josiah Evans Download

This model does not have any ancestors.

This model does not have any descendants.