Compare commits

...

4 Commits

Author SHA1 Message Date
Lol3rrr
8534e314e6 Ignore .DS_Store files 2026-04-19 22:09:21 +02:00
Lol3rrr
f8c6543f5e Start adding new idea for quickfacts 2026-04-19 22:09:00 +02:00
Lol3rrr
53c5e3c1ac Adjust mermaid shortcode 2026-04-19 22:06:57 +02:00
Lol3rrr
171245850d Elaborate on the constraints part and start with a formal specification 2026-03-27 14:49:20 +01:00
5 changed files with 87 additions and 6 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
public/
.DS_Store

View File

@@ -84,12 +84,41 @@ For example an inserter will perform an intersection, because it can only accept
But a belt will perform a union, because might have constraints coming from inserters taking from them and downstream belts so the items can take either path.
Basically the constraints for every edge will be combined using an intersection with the constraints of the node itself, and then all downstream edge constraints will be combined using a union to form the final upstream constraint.
JOIN Operator: used to combine multiple "or" constraints, for example for combining downstream constraints.
This is done by adding all the limits for items together.
### Notation
$c = (l, I, IL) \text{, with}$
- $l \in \mathbb{Q} \text{, the total throughput limit}$
- $I = \text{A set of items} \text{, the set of items 'used' by the constraint}$
- $IL = I \mapsto \mathbb{Q} \text{, the limit for each item}$
CHAIN Operator: used to combine multiple "and" constraints.
### JOIN Operator $\bigcup$
Combines multiple constraints in a logical or kind of fashion.
### Representation
Given $c_1 = (l_1, I_1, IL_1), c_2 = (l_2, I_2, IL_2)$
Then $c = \bigcup \\{c_1, c_2\\} = (l, I, IL)$ with
- $l = max \\{ l_1, l_2 \\}$
- $I = I_1 \cup I_2$
- $IL(i) = \begin{cases}
IL_1(i) + IL_2(i) & \text{, if } i \in I_1 \land i \in I_2 \\\\
IL_1(i) & \text{, if } i \in I_1 \land i \notin I_2 \\\\
IL_2(i) & \text{, if } i \notin I_1 \land i \in I_2 \\\\
0 & \text{else}
\end{cases}$
### CHAIN Operator $\bigcap$
Used to combine multiple constraints in a logical and kind of fashion
Given $c_1 = (l_1, I_1, IL_1), c_2 = (l_2, I_2, IL_2)$
Then $c = \bigcap \\{c_1, c_2\\} = (l, I, IL)$ with
- $l = min \\{ l_1, l_2 \\}$
- $I = I_1 \cap I_2$
- $IL(i) = \begin{cases}
min \\{IL_1(i), IL_2(i)\\} & \text{, if } i \in I_1 \land i \in I_2 \\\\
0 & \text{else}
\end{cases}$
### Graphical Representation
A tree with 3 levels, each doing something different
The lowest level, selects by item.

View File

@@ -0,0 +1,51 @@
+++
title = "Quickfacts - Automata Model"
date = 2026-04-02
description = "Building an automata based model for factorio"
draft = true
[taxonomies]
categories = ["Programming"]
tags = ["Factorio", "Rust"]
[extra]
toc = true
+++
Testing
<!-- more -->
# Idea
Each machine, on its own, can be represented as some kind of automaton.
These types of automata, have special input and output transitions.
Combining two machines into a larger system, means "synchronizing" the two automata, based on their input/output transitions.
So if one machine acts as the input for the other, then they synchronize at their respective input/output edges and then continue running independently.
# Example
{% mermaid() %}
graph LR
S --Output--> S
{% end %}
{% mermaid() %}
graph LR
S --Input--> 1
1 --'-'--> 1
{% end %}
{% mermaid() %}
graph LR
S --'-'--> 1
{% end %}
{% mermaid() %}
graph LR
S --'-'--> 1
{% end %}
```
1: 'Output'----
2 'Input'----
3: ----'Output'
4: ----'Input'
```

View File

@@ -1,3 +1,3 @@
<pre class="mermaid">
{{ body }}
{{ body | safe }}
</pre>

View File

@@ -47,4 +47,4 @@ theme = "toggle" # options: {light, dark, auto, toggle}
toc = true
comments = false
codeblock = true
latex = true