These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Can't get required materials for single run t2 to line up

First post
Author
Badmoons
Industrial Nightmare Inc
#1 - 2014-08-12 17:27:06 UTC
I'm trying to make a impel and I can't get the numbers to line up. The pos array has a 2% me savings and the bpc has a 2% me savings. However, when I figure up how many components I need, i'm a couple off on the larger of the requirements. For example, the base of tungsten carbide is 5250. At 4%, that's 5040. The BPC calls for 5043. If I set the me to 3.960, I get 5043. Anyone else running into this problem?

Thanks
Badmoons
Industrial Nightmare Inc
#2 - 2014-08-12 18:00:57 UTC  |  Edited by: Badmoons
Here's the query I'm trying to use.

select iam.materialTypeID, 1*iam.quantity-ceil(round(1*iam.quantity*(12/100),3)) as quantity
from evestatic.invTypes t1, evestatic.industryActivityProducts iap1, evestatic.industryActivityMaterials iam
where t1.typeID = 11543
and t1.typeID = iap1.productTypeID
and iap1.typeID = iam.typeID
and iap1.activityID = 1
and iam.activityID = 1
and iam.consume = 1

in the select, 1 is the number of runs. 12 is the ME+array. I'm getting 38 for tungsten carbide and 9 for sylramic fibers. it should be 39 and 10

When I ramp it up to 5040 runs, I get 195148 and 48787 when I should get 195593 and 48899.
Badmoons
Industrial Nightmare Inc
#3 - 2014-08-12 18:18:32 UTC  |  Edited by: Badmoons
Found a post that suggested

greatest(1,ceil(iam.quantity*(1-(12/100)))) as quantity

Thanks to Steve Ronuken

came up with

greatest(5040,ceil(iam.quantity*(1-(10/100))*(1-(2/100))*5040))
Cilegon
Volicorp
#4 - 2014-08-12 21:54:42 UTC  |  Edited by: Cilegon
I was having some issues as well and this is what I have - i'm using the raw MS SQL SDE and Des's yaml to SQL import.




DECLARE @itemName varchar(200) = 'Impel'
DECLARE @ME float = .90
DECLARE @buildMod float = .98
DECLARE @runs int = 5040
DECLARE @typeID int

SELECT @typeID = typeID from invTypes where typeName = @itemName

-- Get the materials needed
SELECT typeID = t.typeID,
name = t.typeName,
baseQty = r.quantity,
qtyMEMod = r.quantity * @ME,
qtyBuildMod = (r.quantity * @ME) * @buildMod,
qtyRunMod = CEILING(((r.quantity * @ME) * @buildMod) * @runs)
FROM ramTypeRequirements r
INNER JOIN invTypes t ON t.typeID = r.requiredTypeID
INNER JOIN invBlueprintTypes bt on bt.blueprintTypeID = r.typeID
INNER JOIN invGroups g on g.groupID = t.groupID
WHERE r.activityID = 1
and bt.productTypeID = @typeID
and g.categoryID != 16


So for me, I used your example and compared numbers to here: https://www.fuzzwork.co.uk/blueprint/

Using this calc: CEILING(((r.quantity * @ME) * @buildMod) * @runs) it all matchs as well - This also seems to be the same calc you use above
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#5 - 2014-08-13 12:50:59 UTC
Just for completeness, you /need/ to have a check which makes sure you don't have fewer units than the number of runs.

with mysql, you can just use greatest(:runs,(quantity*(1-(:me/100))*(1-(:facility/100))(1-(:broadteam/100))(1-(:narrowteam/100))*:runs))
but MS SQL doesn't have a built in greatest function, so you have to use case.

case when :runs>(quantity*(1-(:me/100))*(1-(:facility/100))(1-(:broadteam/100))(1-(:narrowteam/100))*:runs) then :runs else (quantity*(1-(:me/100))*(1-(:facility/100))(1-(:broadteam/100))(1-(:narrowteam/100))*:runs)

Or something like that.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Badmoons
Industrial Nightmare Inc
#6 - 2014-08-14 14:40:17 UTC
yeah, ran into that as well. I used

ceil(num_runs/bp_return_qty)

something like

greatest(ceil(num_runs/bp_return_qty(t1.typeid)),ceil(iam.quantity*(1-(cbpowf/100))*(1-(2/100))*ceil(num_runs/bp_return_qty(t1.typeid))))

i don't plan for teams since i'll probably never end up using them.