Files
factorio-scenario-ExpCluster/doc/modules/modules.control.production.html
2019-07-20 23:44:48 +01:00

1282 lines
43 KiB
HTML

<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>modules.control.production module</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../spectre.min.css" type="text/css" />
<link rel="stylesheet" href="../spectre-icons.min.css" type="text/css" />
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div class="container grid-1280">
<div class="columns">
<!-- sidebar start -->
<div id="sidebar" class="column col-3 col-sm-12">
<div class="sidebar-custom">
<div class="project-infobox">
<!-- project title -->
<a href="../index.html"><h1>ExpGaming Scenario</h1></a>
<!-- project description -->
<p class="project-desc">Explosive Gaming's server scenario for 0.17</p>
<!-- project full description -->
</div>
<!-- sidebar navigation -->
<!-- list of items in a module -->
<ul class="nav nav-module-contents">
<li class="nav-item">
<h2>Sections</h2>
<ul class="nav">
<li class="nav-item"><a href="#Dependencies"><span class="fragment-hashtag">#</span> Dependencies</a></li>
<li class="nav-item"><a href="#Precision"><span class="fragment-hashtag">#</span> Precision </a></li>
<li class="nav-item"><a href="#Statistics"><span class="fragment-hashtag">#</span> Statistics </a></li>
<li class="nav-item"><a href="#Formating"><span class="fragment-hashtag">#</span> Formating </a></li>
</ul>
</li>
</ul>
<ul class="nav nav-modules">
<li class="nav-item">
<h2>Modules</h2>
<ul class="nav">
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config._file_loader.html"><span class="module-name-item">config._file_loader</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.action_buttons.html"><span class="module-name-item">config.action_buttons</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.advanced_start.html"><span class="module-name-item">config.advanced_start</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.bonuses.html"><span class="module-name-item">config.bonuses</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.chat_reply.html"><span class="module-name-item">config.chat_reply</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.death_logger.html"><span class="module-name-item">config.death_logger</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.discord_alerts.html"><span class="module-name-item">config.discord_alerts</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.expcore-commands.auth_admin.html"><span class="module-name-item">config.expcore-commands.auth_admin</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.expcore-commands.auth_roles.html"><span class="module-name-item">config.expcore-commands.auth_roles</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.expcore-commands.auth_runtime_disable.html"><span class="module-name-item">config.expcore-commands.auth_runtime_disable</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.expcore-commands.parse_general.html"><span class="module-name-item">config.expcore-commands.parse_general</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.expcore-commands.parse_roles.html"><span class="module-name-item">config.expcore-commands.parse_roles</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.permission_groups.html"><span class="module-name-item">config.permission_groups</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.popup_messages.html"><span class="module-name-item">config.popup_messages</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.rockets.html"><span class="module-name-item">config.rockets</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.roles.html"><span class="module-name-item">config.roles</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.scorched_earth.html"><span class="module-name-item">config.scorched_earth</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.spawn_area.html"><span class="module-name-item">config.spawn_area</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.warnings.html"><span class="module-name-item">config.warnings</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/config.warps.html"><span class="module-name-item">config.warps</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/control.html"><span class="module-name-item">control</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.commands.html"><span class="module-name-item">expcore.commands</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.common.html"><span class="module-name-item">expcore.common</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.html"><span class="module-name-item">expcore.gui</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.concepts.center.html"><span class="module-name-item">expcore.gui.concepts.center</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.concepts.left.html"><span class="module-name-item">expcore.gui.concepts.left</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.concepts.popups.html"><span class="module-name-item">expcore.gui.concepts.popups</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.concepts.toolbar.html"><span class="module-name-item">expcore.gui.concepts.toolbar</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.core.html"><span class="module-name-item">expcore.gui.core</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.buttons.html"><span class="module-name-item">expcore.gui.elements.buttons</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.checkboxs.html"><span class="module-name-item">expcore.gui.elements.checkboxs</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.dropdown.html"><span class="module-name-item">expcore.gui.elements.dropdown</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.elem-button.html"><span class="module-name-item">expcore.gui.elements.elem-button</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.progress-bar.html"><span class="module-name-item">expcore.gui.elements.progress-bar</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.slider.html"><span class="module-name-item">expcore.gui.elements.slider</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.elements.text.html"><span class="module-name-item">expcore.gui.elements.text</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.instances.html"><span class="module-name-item">expcore.gui.instances</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.prototype.html"><span class="module-name-item">expcore.gui.prototype</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.gui.test.html"><span class="module-name-item">expcore.gui.test</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.permission_groups.html"><span class="module-name-item">expcore.permission_groups</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.roles.html"><span class="module-name-item">expcore.roles</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.store.html"><span class="module-name-item">expcore.store</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/expcore.sudo.html"><span class="module-name-item">expcore.sudo</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.addons.advanced-start.html"><span class="module-name-item">modules.addons.advanced-start</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.addons.chat-popups.html"><span class="module-name-item">modules.addons.chat-popups</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.addons.damage-popups.html"><span class="module-name-item">modules.addons.damage-popups</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/Jail.html"><span class="module-name-item">Jail</span></a></div></li>
<li class="nav-item active"><div class="nav-item-block-active block"><a href="../modules/modules.control.production.html"><span class="module-name-item">modules.control.production</span></a><i class="icon icon-arrow-left icon-arrow-left-custom"></i></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.control.reports.html"><span class="module-name-item">modules.control.reports</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.control.warnings.html"><span class="module-name-item">modules.control.warnings</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.gui.player-list.html"><span class="module-name-item">modules.gui.player-list</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.gui.rocket-info.html"><span class="module-name-item">modules.gui.rocket-info</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.gui.science-info.html"><span class="module-name-item">modules.gui.science-info</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/modules.gui.task-list.html"><span class="module-name-item">modules.gui.task-list</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.alien_evolution_progress.html"><span class="module-name-item">utils.alien_evolution_progress</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.core.html"><span class="module-name-item">utils.core</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.debug.html"><span class="module-name-item">utils.debug</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.event.html"><span class="module-name-item">utils.event</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.event_core.html"><span class="module-name-item">utils.event_core</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.math.html"><span class="module-name-item">utils.math</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.recipe_locker.html"><span class="module-name-item">utils.recipe_locker</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.state_machine.html"><span class="module-name-item">utils.state_machine</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.table.html"><span class="module-name-item">utils.table</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.task.html"><span class="module-name-item">utils.task</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../modules/utils.timestamp.html"><span class="module-name-item">utils.timestamp</span></a></div></li>
</ul>
</li>
</ul>
<ul class="nav nav-modules">
<li class="nav-item">
<h2>Topics</h2>
<ul class="nav">
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../topics/readme.md.html"><span class="module-name-item">readme.md</span></a></div></li>
<li class="nav-item"><div class="nav-item-block-inactive block"><a href="../topics/license.html"><span class="module-name-item">license</span></a></div></li>
</ul>
</li>
</ul>
</div>
<div class="up-to-top">
<!-- list of items in a module -->
<ul class="nav nav-module-contents">
<li class="nav-item">
<h4>Jump to Section</h4>
<ul class="nav">
<li class="nav-item"><a href="#Dependencies"><span class="fragment-hashtag">#</span> Dependencies</a></li>
<li class="nav-item"><a href="#Precision"><span class="fragment-hashtag">#</span> Precision </a></li>
<li class="nav-item"><a href="#Statistics"><span class="fragment-hashtag">#</span> Statistics </a></li>
<li class="nav-item"><a href="#Formating"><span class="fragment-hashtag">#</span> Formating </a></li>
</ul>
</li>
</ul>
<a href="#">Top <i class="icon icon-upward"></i></a>
</div>
</div>
<!-- sidebar end -->
<!-- content body start -->
<div class="column col-9 col-sm-12">
<!-- module list on the main page start -->
<!-- module list on the main page end -->
<!-- module contents -->
<!-- module content header start -->
<h2><span class="body-module-name"><strong><em>modules.control.production</em></strong></span> module</h2>
<p>Control Module - Production
- Common functions used to track production of items</p>
<p></p>
<!-- module info start -->
<!-- module info end -->
<!-- module usage start -->
<h3>Usage</h3>
<pre class="code" data-lang="Lua"><code>
<span class="comment">-- import the module from the control modules
</span> <span class="keyword">local</span> Production = <span class="global">require</span> <span class="string">'modules.control.production'</span>
<span class="comment">-- This will return the less precise index from the one given
</span> <span class="comment">-- this means that one_second will return one_minute or ten_hours will return fifty_hours
</span> <span class="comment">-- the other precision work like wise
</span> Production.precision_up(defines.flow_precision_index.one_second)
<span class="comment">-- The get production function is used to get production, consumion and net
</span> <span class="comment">-- it may be used for any item and with any precision level, use total for total
</span> Production.get_production(game.forces.player,<span class="string">'iron-plate'</span>,defines.flow_precision_index.one_minute)
<span class="comment">-- The fluctuations works by compearing recent production with the average over time
</span> <span class="comment">-- again any precision may be used, apart from one_thousand_hours as there would be no valid average
</span> Production.get_fluctuations(game.forces.player,<span class="string">'iron-plate'</span>,defines.flow_precision_index.one_minute)
<span class="comment">-- ETA is calculated based on what function you use but all share a similar method
</span> <span class="comment">-- for production eta it will take current production average given by the precision
</span> <span class="comment">-- and work out how many ticks it will require to make the required amount (1000 by default)
</span> Production.get_production_eta(game.forces.player,<span class="string">'iron-plate'</span>,defines.flow_precision_index.one_minute,<span class="number">250000</span>)
<span class="comment">-- Both get_color and format_number are helper functions to help format production stats
</span> <span class="comment">-- get_color will return green,orange,red,or grey based on the active_value
</span> <span class="comment">-- the passive_value is used when active_value is 0 and can only return orange,red,or grey
</span> Production.get_color(clamp,active_value,passive_value)</code></pre>
<!-- module usage end -->
<!-- module content header end -->
<!-- module section list start -->
<table class="section-content-list">
<thead>
<h3><a href="#Dependencies">Dependencies</a></h3>
<span></span>
</thead>
<tbody>
<tr>
<td class="name"><a href="#resources.color_presets">resources.color_presets</a></td>
<td class="summary">Provides colors for Production.get_color</td>
</tr>
<tr>
<td class="name"><a href="#util">util</a></td>
<td class="summary">Provides format_number function to add surfixs</td>
</tr>
</tbody>
</table>
<table class="section-content-list">
<thead>
<h3><a href="#Precision">Precision </a></h3>
<span></span>
</thead>
<tbody>
<tr>
<td class="name"><a href="#precision_up">precision_up (precision)</a></td>
<td class="summary">Gets the next lesser precision index value, eg 1 second -> 1 minute</td>
</tr>
<tr>
<td class="name"><a href="#precision_down">precision_down (precision)</a></td>
<td class="summary">Gets the next greater precision index value, eg 1 minute -> 1 second</td>
</tr>
<tr>
<td class="name"><a href="#precision_ticks">precision_ticks (precision)</a></td>
<td class="summary">Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks</td>
</tr>
</tbody>
</table>
<table class="section-content-list">
<thead>
<h3><a href="#Statistics">Statistics </a></h3>
<span></span>
</thead>
<tbody>
<tr>
<td class="name"><a href="#get_production_total">get_production_total (force, item_name)</a></td>
<td class="summary">Returns the production data for the whole game time</td>
</tr>
<tr>
<td class="name"><a href="#get_production">get_production (force, item_name, precision)</a></td>
<td class="summary">Returns the production data for the given precision game time</td>
</tr>
<tr>
<td class="name"><a href="#get_fluctuations">get_fluctuations (force, item_name, precision)</a></td>
<td class="summary">Returns the current fluctuation from the average</td>
</tr>
<tr>
<td class="name"><a href="#get_production_eta">get_production_eta (force, item_name, precision[, required=1000])</a></td>
<td class="summary">Returns the amount of ticks required to produce a certain amount</td>
</tr>
<tr>
<td class="name"><a href="#get_consumsion_eta">get_consumsion_eta (force, item_name, precision[, required=1000])</a></td>
<td class="summary">Returns the amount of ticks required to consume a certain amount</td>
</tr>
<tr>
<td class="name"><a href="#get_net_eta">get_net_eta (force, item_name, precision[, required=1000])</a></td>
<td class="summary">Returns the amount of ticks required to produce but not consume a certain amount</td>
</tr>
</tbody>
</table>
<table class="section-content-list">
<thead>
<h3><a href="#Formating">Formating </a></h3>
<span></span>
</thead>
<tbody>
<tr>
<td class="name"><a href="#get_color">get_color (clamp, active_value, passive_value)</a></td>
<td class="summary">Returns a color value bassed on the value that was given</td>
</tr>
<tr>
<td class="name"><a href="#format_number">format_number (value)</a></td>
<td class="summary">Returns three parts used to format a number</td>
</tr>
</tbody>
</table>
<!-- module section list end -->
<br />
<!-- section start -->
<h3><span id="Dependencies" class="section-title"><a href="#Dependencies">Dependencies</a></span></h3>
<dl class="section-body-container">
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#resources.color_presets" class="fragment-hashtag">#</a>
<span class="section-item-title" id="resources.color_presets">resources.color_presets</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Provides colors for Production.get_color</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<!-- parameters end -->
<!-- returns start -->
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#util" class="fragment-hashtag">#</a>
<span class="section-item-title" id="util">util</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Provides format_number function to add surfixs</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<!-- parameters end -->
<!-- returns start -->
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
</dl>
<h3><span id="Precision" class="section-title"><a href="#Precision">Precision </a></span></h3>
<dl class="section-body-container">
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#precision_up" class="fragment-hashtag">#</a>
<span class="section-item-title" id="precision_up">precision_up (precision)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Gets the next lesser precision index value, eg 1 second -> 1 minute</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
<span class="return-text">the next precision value</span>
</li>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the multiplicive difference between the values</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#precision_down" class="fragment-hashtag">#</a>
<span class="section-item-title" id="precision_down">precision_down (precision)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Gets the next greater precision index value, eg 1 minute -> 1 second</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
<span class="return-text">the next precision value</span>
</li>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the multiplicive difference between the values</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#precision_ticks" class="fragment-hashtag">#</a>
<span class="section-item-title" id="precision_ticks">precision_ticks (precision)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Gets the number of tick that precision is given over, eg 1 minute -> 60 ticks</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the number of ticks in this time</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
</dl>
<h3><span id="Statistics" class="section-title"><a href="#Statistics">Statistics </a></span></h3>
<dl class="section-body-container">
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_production_total" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_production_total">get_production_total (force, item_name)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the production data for the whole game time</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
<span class="return-text">contains total made, used and net</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_production" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_production">get_production (force, item_name, precision)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the production data for the given precision game time</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
the precision that you want the data given to
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
<span class="return-text">contains made, used and net</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_fluctuations" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_fluctuations">get_fluctuations (force, item_name, precision)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the current fluctuation from the average</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
the precision that you want the data given to
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
<span class="return-text">contains made, used and net</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_production_eta" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_production_eta">get_production_eta (force, item_name, precision[, required=1000])</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the amount of ticks required to produce a certain amount</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
the precision that you want the data given to
</li>
<li class="section-subitem-li">
<strong><em>required</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
the number of items that are required to be made
(<em>default</em>: 1000)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the number of ticks required to produce this ammount of items</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_consumsion_eta" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_consumsion_eta">get_consumsion_eta (force, item_name, precision[, required=1000])</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the amount of ticks required to consume a certain amount</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
the precision that you want the data given to
</li>
<li class="section-subitem-li">
<strong><em>required</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
the number of items that are required to be consumed
(<em>default</em>: 1000)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the number of ticks required to consume this ammount of items</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_net_eta" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_net_eta">get_net_eta (force, item_name, precision[, required=1000])</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns the amount of ticks required to produce but not consume a certain amount</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>force</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/LuaForce.html">LuaForce</a></span>)
the force to get the data for
</li>
<li class="section-subitem-li">
<strong><em>item_name</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
the name of the item that you want the data about
</li>
<li class="section-subitem-li">
<strong><em>precision</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/defines.html#defines.flow">defines.flow_precision_index</a></span>)
the precision that you want the data given to
</li>
<li class="section-subitem-li">
<strong><em>required</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
the number of items that are required to be made but not used
(<em>default</em>: 1000)
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
<span class="return-text">the number of ticks required to produce, but not use, this ammount of items</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
</dl>
<h3><span id="Formating" class="section-title"><a href="#Formating">Formating </a></span></h3>
<dl class="section-body-container">
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#get_color" class="fragment-hashtag">#</a>
<span class="section-item-title" id="get_color">get_color (clamp, active_value, passive_value)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns a color value bassed on the value that was given</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>clamp</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
value which seperates the different colours
</li>
<li class="section-subitem-li">
<strong><em>active_value</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
first value tested, tested against clamp
</li>
<li class="section-subitem-li">
<strong><em>passive_value</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
second value tested, tested against 0
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.5.html">table</a></span>)
<span class="return-text">contains r,g,b keys</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
<dt>
<div class="divider divider-custom"></div>
<div class="block section-item-header">
<a href="#format_number" class="fragment-hashtag">#</a>
<span class="section-item-title" id="format_number">format_number (value)</span>
</div>
</dt>
<dd>
<div class="section-item-body">
<p class="section-item-summary">Returns three parts used to format a number</p>
<p class="section-item-description"></p>
<!-- parameters start -->
<strong>Parameters:</strong>
<ul>
<li class="section-subitem-li">
<strong><em>value</em></strong>
<strong> : </strong>
(<span class="types"><a class="type" href="https://www.lua.org/pil/2.3.html">number</a></span>)
the value to format
</li>
</ul>
<!-- parameters end -->
<!-- returns start -->
<strong>Returns:</strong>
<ul>
<li>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
<span class="return-text">the sign for the number</span>
</li>
<li>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
<span class="return-text">the surfix for any unit used</span>
</li>
<li>
(<span class="types"><a class="type" href="http://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>)
<span class="return-text">the number formated</span>
</li>
</ul>
<!-- returns end -->
<!-- see also start -->
<!-- see also end -->
<!-- usage start -->
<!-- usage end -->
</dd>
</dl>
<!-- section end -->
</div>
</div>
</div>
<div class="footer container grid-1280">
<div class="divider divider-custom"></div>
<div class="footer-columns columns">
<div class="sidebar-footer column col-3 col-sm-12">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc </a></i>
</div>
<div class="content-footer column col-9 col-sm-12">
<i>Last updated 2019-07-20 22:30:35 UTC</i>
</div>
</div>
</div>
</body>
</html>