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

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

Science & Industry

 
  • Topic is locked indefinitely.
 

Manufacturing Material Requirments Formula

First post
Author
Star Killer14
Core World Imperium
#1 - 2015-03-20 05:12:08 UTC
Hello everyone,

I am having some trouble understanding the formula for the required materials for a blueprint:

materialsRequired = max(runs,ceil(round(runs∗baseQuantity∗materialModifier,2))

I do not understand what purpose the 2 serves in this formula.

Thanks
Chenguang Hucel-Ge
Garoun Investment Bank
Gallente Federation
#2 - 2015-03-20 08:23:51 UTC
Star Killer14 wrote:
Hello everyone,

I am having some trouble understanding the formula for the required materials for a blueprint:

materialsRequired = max(runs,ceil(round(runs∗baseQuantity∗materialModifier,2))

I do not understand what purpose the 2 serves in this formula.

Thanks

I suck at math, but it's most likely that thing that does not allow you to build 10 paladins with 9 apocalypses.
Selaria Unbertable
Bellator in Capsulam
#3 - 2015-03-20 09:31:27 UTC
Star Killer14 wrote:
Hello everyone,

I am having some trouble understanding the formula for the required materials for a blueprint:

materialsRequired = max(runs,ceil(round(runs∗baseQuantity∗materialModifier,2))

I do not understand what purpose the 2 serves in this formula.

Thanks


The formula is probably from http://eve-industry.org/export/IndustryFormulas.pdf. The 2 refers to additional and now obsolete team modifiers. You can safely ignore it.

Chenguang Hucel-Ge wrote:

I suck at math, but it's most likely that thing that does not allow you to build 10 paladins with 9 apocalypses.


Nope, that's what the max(runs... part is for, preventing you from requiring less then 1 item per run for a job, even with multiple items build.
Bagatur I
Caldari Provisions
Caldari State
#4 - 2015-03-20 11:31:30 UTC
if the round function is like any other, 2 refers to the rounding precision, meaning second decimal number. why I have no idea.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#5 - 2015-03-20 17:39:46 UTC  |  Edited by: Steve Ronuken
It's to get round a floating point error.

Floating point math can be a little messy, and end up with 0.0000001's (actually more zeros) being added to things, just due to how you have to represent some numbers in binary.

With the ceil, that would go up to the next integer, even when it shouldn't. So you round it first, and that eliminates the problem.

I'd give an example, but I can't remember a set of numbers that triggers it.


So the 2 is the precision for the round, so it rounds to 2 decimal places, then ceils it.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Zifrian
The Frog Pond
Ribbit.
#6 - 2015-03-20 18:45:24 UTC  |  Edited by: Zifrian
Steve Ronuken wrote:
It's to get round a floating point error.

Floating point math can be a little messy, and end up with 0.0000001's (actually more zeros) being added to things, just due to how you have to represent some numbers in binary.

With the ceil, that would go up to the next integer, even when it shouldn't. So you round it first, and that eliminates the problem.

I'd give an example, but I can't remember a set of numbers that triggers it.


So the 2 is the precision for the round, so it rounds to 2 decimal places, then ceils it.

If that's the case then use a fix function that rounds down in all cases.

Maximze your Industry Potential! - Download EVE Isk per Hour!

Import CCP's SDE - EVE SDE Database Builder

Star Killer14
Core World Imperium
#7 - 2015-03-21 06:30:28 UTC
I am trying to figure out why the equation isn't working for me, I am always 1 material short when I check it in game. I tried using two different formulas to see if it was a decimal error.

One formula is, without something taking 2 deciamals.

materialsRequired = max(runs,ceil(round(runs∗baseQuantity∗materialModifier))


The other is supposed to take the first 2 decimals.

materialsRequired = max(runs,ceil(round(runs∗baseQuantity∗materialModifier,2))


If it would be helpful i can copy and paste the code from my program, i am using java.

Thanks

Kerli Alexander
Seraphim Securities
#8 - 2015-03-23 15:07:57 UTC  |  Edited by: Kerli Alexander
I'm trying to work this out using Excel, and hitting a brick wall...

Until now, I've just been approximating the result by adding a multiplier that spits out an answer that matches the in-game results, for a pre-set number of runs. I've got no idea how to formulate this, so that excel can adjust for varying batch sizes.

I'm backing-up my old HD at the moment, otherwise I'd post the formula I'm using atm...

The formula I'm trying during the back-up - based on the above - is spitting out hilariously wrong results; 2 instead of 100, 500 instead of 5000... :(


Maybe I'm misunderstanding this... I've been away from manufacturing since just before Teams were introduced... Did I read somewhere (in an old Dev Blog) that there was a materials-discount type thing, on bulk manufacture jobs?

I just used the Fuzzworks site to try something out, and it didn't seem so.
Kerli Alexander
Seraphim Securities
#9 - 2015-03-23 16:49:35 UTC
Kerli Alexander wrote:
I'm trying to work this out using Excel, and hitting a brick wall...

Until now, I've just been approximating the result by adding a multiplier that spits out an answer that matches the in-game results, for a pre-set number of runs. I've got no idea how to formulate this, so that excel can adjust for varying batch sizes.

I'm backing-up my old HD at the moment, otherwise I'd post the formula I'm using atm...

The formula I'm trying during the back-up - based on the above - is spitting out hilariously wrong results; 2 instead of 100, 500 instead of 5000... :(


Maybe I'm misunderstanding this... I've been away from manufacturing since just before Teams were introduced... Did I read somewhere (in an old Dev Blog) that there was a materials-discount type thing, on bulk manufacture jobs?

I just used the Fuzzworks site to try something out, and it didn't seem so.

Using the formula (in Excel):
=MAX(D8,(ROUND(I8*D8*0.9,0)))

(Where D8 = Number of Runs, I8 = Base Number of Materials, and 0.9 = The Blueprint's efficiency)

Gets me the exact same results as Fuzzworks, in every example I've tried so far.

I guess I was wrong about reading that large job numbers get a discount...
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#10 - 2015-03-23 19:26:49 UTC
Kerli Alexander wrote:
Kerli Alexander wrote:
I'm trying to work this out using Excel, and hitting a brick wall...

Until now, I've just been approximating the result by adding a multiplier that spits out an answer that matches the in-game results, for a pre-set number of runs. I've got no idea how to formulate this, so that excel can adjust for varying batch sizes.

I'm backing-up my old HD at the moment, otherwise I'd post the formula I'm using atm...

The formula I'm trying during the back-up - based on the above - is spitting out hilariously wrong results; 2 instead of 100, 500 instead of 5000... :(


Maybe I'm misunderstanding this... I've been away from manufacturing since just before Teams were introduced... Did I read somewhere (in an old Dev Blog) that there was a materials-discount type thing, on bulk manufacture jobs?

I just used the Fuzzworks site to try something out, and it didn't seem so.

Using the formula (in Excel):
=MAX(D8,(ROUND(I8*D8*0.9,0)))

(Where D8 = Number of Runs, I8 = Base Number of Materials, and 0.9 = The Blueprint's efficiency)

Gets me the exact same results as Fuzzworks, in every example I've tried so far.

I guess I was wrong about reading that large job numbers get a discount...



Large jobs get a 'discount' because the ceil function doesn't bump the material as much.

Say you have something with 2 of a material in it. 0.9 doesn't help there, as it drops to 1.8, then goes back up to 2 with the ceil

At 10 runs, you're saving 2 of the material, over doing 10 1 run jobs.

It's not huge, admittedly, but it's not inconsequential. And with many of the bonuses being smaller (2% from an array, for example) more runs would be needed.

And that's not the right function. you may get close to the right numbers, but it's not accurate.

Math.max(runs,Math.ceil((material.quantity*(1-(me/100))*facilityme[facility]*)*runs));

is what I'm using. though I should really stick the round in, to get round the floating point error (which is, admittedly, minor)

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Star Killer14
Core World Imperium
#11 - 2015-03-23 19:55:18 UTC
Thanks everyone for the help, I believe I have it working correctly.
Kerli Alexander
Seraphim Securities
#12 - 2015-03-24 01:13:52 UTC  |  Edited by: Kerli Alexander
Steve Ronuken wrote:

And that's not the right function. you may get close to the right numbers, but it's not accurate.

Math.max(runs,Math.ceil((material.quantity*(1-(me/100))*facilityme[facility]*)*runs));

is what I'm using. though I should really stick the round in, to get round the floating point error (which is, admittedly, minor)

Thanks for the reply, Steve.

To be upfront, I haven't programmed since the days of Cobol and Pascal, so when I try to get my head around this I only have Excel as a current frame of reference, and my grasp of maths (outside of arithmetic) is terrible; so please forgive the following... and if you can clear it up, I'll owe you a drink next time I see you at the Glasgow Meet ;)

Firstly - yes, you were right that my formula was off (there were instances I hadn't yet bumped into, where ROUND was rounding down instead of up) - for example; on a single run of 6 materials at 0.9 eff., it was rounding the 5.4 result down to 5, instead of keeping it at 6. Swapping ROUND for ROUNDUP has fixed that. (I'd also typed one of the bits the wrong way round...)

Otherwise though, to use your example;

A 10 run production of 2 materials definitely comes out at 18 (using 0.9 as the BP efficiency), not 20.
and a single run, of the same, would have come out correctly as 2, and not 1.8; as the "ROUND XYZ, 0" function would have resolved that... (The 'zero' part of it forces the decimal part of the result to be rounded to a 'single integer').

I'm really struggling to understand the purpose of the CEIL/CEILING part, though... (in Excel, at least) I can't see any purpose in having it.

Excel doesn't (seem) to have any 'floating point' problem that I can see, and the ROUNDUP function resolves any problem with getting (incorrect) 'free' materials in everything I've tried so far.

I'm not currently producing at a POS though, so maybe the 2% might make a difference, but at the same time, I can't see why simply adding a " *0.98" modifier wouldn't clear that up...

My corrected formula, in case yourself, or anyone, can see anything wrong:

MaterialsRequired=MAX(Runs,(ROUNDUP((BaseMaterialQuantity*0.9)*Runs,0)))


On a completely separate note, I've been trying to fathom a way to approximate 'Job Install Cost' - I can ballpark-it to within a few hundred Isk, (using some time-consuming arithmetic), but the actual formula is beyond my Excel skills, and appears to have been written by Satan ;)
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#13 - 2015-03-24 06:50:12 UTC
ceil is roundup. it's the same function. Round up to the next integer.

it's entirely possible that excel is handling the floating point stuff behind the scenes. I just know it can creep in in javascript and some other languages.

try
roundup(104*0.9*60)
and
roundup(104*60*0.9)


http://tinyurl.com/onrhvp3
and
http://tinyurl.com/nhun8e3

And you'll see the joys of floating point math.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter