Conveyor.DecisionPoint current = ownerobject(c); Object item = param(1); Conveyor conveyor = param(2); Conveyor.Item conveyorItem = conveyor.itemData[item]; /**send Item*/ // 1. send item by percentage if(bernoulli(30, 1, 0)){ Conveyor.sendItem(item, current.outObjects[1]); } // 2. send item by item type (label) Array dpArray = current.outObjects.toArray(); //int itemType = item.Type; for (int index = 1; index <= dpArray.length; index++){ if(item.Type == index){ Conveyor.sendItem(item, current.outObjects[index]); } } // 3. same as previous but shorter Conveyor.sendItem(item, current.outObjects[item.Type]);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter