Wiring

MaddTech uses various cables and pipes to interconnect machines. Unlike a lot of other mods, MaddTech pipes/cables are stateless - they are nothing more than just simple blocks, and they store no additional information. When machines talk to each other, they follow a set of wiring rules, described here. This does not include redstone cables, which simply follow standard Minecraft redstone rules. You can exploit MaddTech wiring rules to make more deterministic constructions.

Enumeration
When a machine wants to talk to another machine it runs a specific type of search (e.g. an energy search or a fluid search). The search performs enumaration - it makes an ordered list of machines connected to the searching machine.

The enumeration happens as follows: when following a straight path of cable, upon encountering a possible turn, it will definitely turn - it's called branch preference. This way, if machines are connected to a straight cable, the closest machine will be listed first. Also, it turns up/down before turning to sides.

The order of enumeration is significant in some cases - for example, in setting up electrical systems, you'd want machines to find your solar panels before finding your nuclear reactor - this way, the solar panels will provide energy during the day, and the reactor will provide it during the night, minimizing the demand for uranium/plutonium.

Special hubs
During enumration, the search may also find special hubs, such as power switches. The process of enumeration depends on the state of those hubs - for example, the serch will be blocked by a power switch or power valve unless it is receiving a redstone signal. Other mods can use the MaddTech API to add other such hubs.