window title="Population Simulation" #onClose=".workingDirQuit"

menu nitems=1 label=File
  menuitem label="Save As..." function=doAction action="calcAssess(act=`save`)"
  #menuitem label=Exit function=".workingDirQuit"
menu nitems=3 label=View
  menu nitems=1 label=Docs     
    menuitem label="Background" function=openFile action=PopSimDoc.pdf
  menuitem label="R Code" function=openFile action=PopSim.r
  menuitem label=Window   function=openFile action=PopSimWin.txt

notebook tabs="Parameters Display" name=nbpop #width=380 height=150
#---------------------------LEFT
grid 2 1
	grid 1 2 sticky=NW
		grid 17 2 sticky=NW padx="2 10"
			label text="Maturity parameters" font=bold sticky=W
			null
			label text="Age class at 50% maturity" sticky=W
			entry name=am50 value=2 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`am50`)"
			label text="Age class at 95% maturity" sticky=W
			entry name=am95 value=5 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`am95`)"
			label text="Selectivity parameters" font=bold sticky=W
			null
			label text="Age class at 50% selectivity" sticky=W
			entry name=as50 value=4 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`as50`)"
			label text="Age class at 95% selectivity" sticky=W
			entry name=as95 value=5 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`as95`)"
			label text="Weight parameters" font=bold sticky=W
			null
			label text="w infinity (kg)" sticky=W
			entry name=winf value="1.5" mode=numeric width=7 sticky=W function=doAction action="tget(calcAssess)(act=`winf`)"
			label text="L infinity (mm)" sticky=W
			entry name=linf value="500" mode=numeric width=7 sticky=W function=doAction action="tget(calcAssess)(act=`linf`)"
			label text="VonBertalanffy b" sticky=W
			entry name=b value="2.8" mode=numeric width=7 sticky=W    function=doAction action="tget(calcAssess)(act=`b`)"
			label text="VonBertalanffy t0" sticky=W
			entry name=t0 value="-0.2" mode=numeric width=7 sticky=W  function=doAction action="tget(calcAssess)(act=`t0`)"
			label text="VonBertalanffy K" sticky=W
			entry name=k value="0.2" mode=numeric width=7 sticky=W    function=doAction action="tget(calcAssess)(act=`k`)"
			label text="Other parameters" font=bold sticky=W
			null
			label text="Natural mortality rate" sticky=W
			entry name=M value=0.05 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`M`)"
			label text="Mean recruitment (units)" sticky=W
			entry name=R value=1 mode=numeric width=7 sticky=W        function=doAction action="tget(calcAssess)(act=`R`)"
			label text=Catchability sticky=W
			entry name=q value=1 mode=numeric width=7 sticky=W        function=doAction action="tget(calcAssess)(act=`q`)"
			check name=chk checked=T text="Enable constraints" mode=logical sticky=W
			null
		grid 14 2 sticky=NE
			label text="Fishing rates" font=bold sticky=W
			null
			label text=h1 sticky=W
			entry name=h1 value=3 mode=numeric width=7 sticky=W       function=doAction action="tget(calcAssess)(act=`h1`)"
			label text=h2 sticky=W
			entry name=h2 value=1 mode=numeric width=7 sticky=W       function=doAction action="tget(calcAssess)(act=`h2`)"
			label text="Time span" font=bold sticky=W
			null
			label text="Number of age classes" sticky=W
			entry name=A value=30 mode=numeric width=7 sticky=W       function=doAction action="tget(calcAssess)(act=`A`)"
			label text="Number of years" sticky=W
			entry name=T value=40 mode=numeric width=7 sticky=W       function=doAction action="tget(calcAssess)(act=`T`)"
			label text="Standard errors       " font=bold sticky=W
			null
			label text="Recruitment process error" sticky=W
			entry name=sigma1 value=1 mode=numeric width=7 sticky=W   function=doAction action="tget(calcAssess)(act=`sigma1`)"
			label text="Recruitment autocorrelation"  sticky=W
			entry name=gamma1 value=0.5 mode=numeric width=7 sticky=W function=doAction action="tget(calcAssess)(act=`gamma1`)"
			label text="Survival process error" sticky=W
			entry name=sigma2 value=0.9 mode=numeric width=7 sticky=W function=doAction action="tget(calcAssess)(act=`sigma2`)"
			label text="Index measurement error" sticky=W
			entry name=tau1 value=1 mode=numeric width=7 sticky=W     function=doAction action="tget(calcAssess)(act=`tau1`)"
			label text="Age measurement error    " sticky=W
			null
			radio name=doDir mode=logical text="Logistic Normal sd" value=FALSE selected=TRUE sticky=W padx=5
			entry name=tau2 value=0.9 mode=numeric width=7 sticky=W  function=doAction action="tget(calcAssess)(act=`tau2`)"
			radio name=doDir mode=logical text="Dirichlet effective N" value=TRUE selected=FALSE sticky=W padx=5
			entry name=dirN value=100 mode=numeric width=7 sticky=W  function=doAction action="tget(calcAssess)(act=`dirN`)"
	text name=msg value="Parameter notes:" height=3 width=60 edit=TRUE

#---------------------------RIGHT
grid 2 1
grid 1 2 sticky=W
	grid 15 1 sticky=NW padx="5 45"
		label text="Choose a display" font=bold sticky=W
		label text="Hidden states" font="11" sticky=W
		radio name=plotType value=recruit   text="Recruits"                mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=total     text="Total population"        mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=spawner   text="Spawners"                mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=select    text="Selected population"     mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=compare   text="Comparison chart"        mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=spawnVSrt text="Recruitment vs spawners" mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=dbubble   text="Theoretical ages"        mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=sbubble   text="True ages"               mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=fish      text="Fishing mortality"       mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		label text="Measurements" font="11" sticky=W
		radio name=plotType value=catch     text="Catch"                   mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=index     text="Observed index"          mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
		radio name=plotType value=pbubble   text="Observed ages"           mode=character sticky=W function=doAction action="tget(calcAssess)(act=`disp`)"
	grid 4 1 sticky=NE
		grid 1 4 stick=""
			label text=View: font=bold
			button text=Docs     function=openFile action=PopSimDoc.pdf
			button text="R Code" function=openFile action=PopSim.r
			button text=Window   function=openFile action=PopSimWin.txt
		grid 2 1 sticky=NE
			label text="Display properties" font=bold sticky="" pady="10 0"
			grid 5 2 sticky=""
				label text="Max bubble size     " sticky=W
				entry name=maxB value=0.15 mode=numeric width=5 sticky=W  function=doAction action="tget(calcAssess)(act=`disp`)"
				label text="Bubble power" sticky=W
				entry name=powr value=0.5 mode=numeric width=5 sticky=W   function=doAction action="tget(calcAssess)(act=`disp`)"
				label text="Highlight top" sticky=W
				grid 1 2
					entry name=percent value=10 mode=numeric width=5 sticky=E function=doAction action="tget(calcAssess)(act=`disp`)"
					label text="%" sticky=W
				label text="Display numbers" sticky=W
				radio name=unitType value=numbers mode=character  function=doAction action="tget(calcAssess)(act=`disp`)"
				label text="Display biomass" sticky=W
				radio name=unitType value=biomass mode=character  function=doAction action="tget(calcAssess)(act=`disp`)"
		grid 1 3 pady=10
			button text="Interact" sticky=W                      function=doAction action="tget(calcAssess)(act=`interact`)"
			button text="Save As..." sticky=W                    function=doAction action="tget(calcAssess)(act=`save`)"
			button text="Recalculate" sticky=W bg=greenyellow    function=doAction action="tget(calcAssess)(act=`recalc`)"
		grid 2 1
			label text="History" font=bold
			history 
	text name=msg2 value="Display notes:" height=3 width=60 edit=TRUE pady="10 0"

