n01487477
Posts: 4551
Joined: 2/21/2006 From: AE:96,160 @ 103,55 Status: offline
|
PseudoCode enabled. 1. Work out the rearm cost for the device. if deviceID = 195 then rearm = 500 if deviceID = 196 then rearm = 1500 if deviceType = DPGUN or NAVYGUN or FLAK then rearm device = Effectiveness() * 2; if deviceType = ASW or TORPEDO ) then rearm = d.GetLoadCost(); 2. Work out the PortNavalSupport for each level of PortSize // basic Port rearm levels with no Naval Support port_ReArmLevel[] = {0,15,25,40,110,300,700,5500,6000,6500,9999}; if(port_ReArmLevel[portsize] >= rearm cost) // so for each port rearm level checks rearm cost then no naval support required. else if (portSize ==1) NavalSupport = roundup((0.2*reArmCost)-3); else if (portSize <= 10) NavalSupport = roundup((0.2*reArmCost)-(port_ReArmLevel[portSize-1]/5)); Not great pseudo code - but I guess you can get the point. Also, this is not fully tested so if there are errors - not my fault...use at your own risk and if you find errors please give me feedback Cheers
< Message edited by n01487477 -- 12/25/2012 3:32:23 PM >
_____________________________
-Damian- EconDoc TrackerAE Tutes
|