Q:

factory floor simulation

I would like to create a simulation of a factory floor, and I am looking for ideas on how to do this. My thoughts so far are:
•   A factory is a made up of a bunch of processes, some of these processes are in series and some are in parallel. Each process would communicate with it's upstream and downstream and parallel neighbors to let them know of it’s through put
•   Each process would it's own basic attributes like maximum throughput, cost of maintenance as a result of through put
Obviously I have not fully thought this out, but I was hoping somebody might be able to give me a few ideas or perhaps a link to an on line resource
update:
This project is only for my own entertainment, and perhaps learn a little bit alnong the way. I am not employed as a programmer, programming is just a hobby for me. I have decided to write it in C#.

A:

Simulating an entire factory accurately is a big job.
Firstly you need to figure out: why are you making the simulation? Who is it for? What value will it give them? What parts of the simulation are interesting? How accurate does it need to be? What parts of the process don't need to be simulated accurately?
To figure out the answers to these questions, you will need to talk to whoever it is that wants the simulation written.
Once you have figured out what to simulate, then you need to figure out how to simulate it. You need some models and some parameters for those models. You can maybe get some actual figures from real production and try to derive models from the figures. The models could be a simple linear relationship between an input and an output, a more complex relationship, and perhaps even a stochastic (random) effect. If you don't have access to real data, then you'll have to make guesses in your model, but this will never be as good so try to get real data wherever possible.
You might also want to consider to probabilities of components breaking down, and what affect that might have. What about the workers going on strike? Unavailability of raw materials? Wear and tear on the machinery causing progressively lower output over time? Again you might not want to consider these details, it depends on what the customer wants.
If your simulation involves random events, you might want to run it many times and get an average outcome, for example using a Monte Carlo simulation.
To give a better answer, we need to know more about what you need to simulate and what you want to achieve.

A:

Since your customer is yourself, you'll need to decide the answer to all of the questions that Mark Byers asked.  However, I'll give you some suggestions and hopefully they'll give you a start.
Let's assume your factory takes a few different parts and assembles them into just one finished product.  A flowchart of the assembly process might look like this:
Factory Flowchart http://img62.imageshack.us/img62/863/factoryflowchart.jpg
For the first diamond, where widgets A and B are assembled, assume it takes on average 30 seconds to complete this step.  We'll assume the actual time it takes the two widgets to be assembled is distributed normally, with mean 30 s and variance 5 s.  For the second diamond, assume it also takes on average 30 seconds, but most of the time it doesn't take nearly that long, and other times it takes a lot longer.  This is well approximated by an exponential distribution, with 30 s as the rate parameter, often represented in equations by a lambda.
For the first process, compute the time to assemble widgets A and B as:
timeA = randn(mean, sqrt(variance)); // Assuming C# has a function for a normally
                                     // distributed random number with mean and 
                                     // sigma as inputs

For the second process, compute the time to add widget C to the assembly as:
timeB = rand()/lambda;  // Assuming C# has a function for a uniformly distributed
                        // random number

Now your total assembly time for each iGadget will be timeA + timeB + waitingTime.  At each assembly point, store a queue of widgets waiting to be assembled.  If the second assembly point is a bottleneck, it's queue will fill up.  You can enforce a maximum size for its queue, and hold things further up stream when that max size is reached.  If an item is in a queue, it's assembly time is increased by all of the iGadgets ahead of it in the assembly line.  I'll leave it up to you to figure out how to code that up, and you can run lots of trials to see what the total assembly time will be, on average.  What does the resultant distribution look like?
Ways to "spice this up":

Require 3 B widgets for every A widget.  Play around with inventory.  Replenish inventory at random intervals.
Add a quality assurance check (exponential distribution is good to use here), and reject some of the finished iGadgets.  I suggest using a low rejection rate.
Try using different probability distributions than those I've suggested.  See how they affect your simulation.  Always try to figure out how the input parameters to the probability distributions would map into real world values.

You can do a lot with this simple simulation.  The next step would be to generalize your code so that you can have an arbitrary number of widgets and assembly steps. This is not quite so easy.  There is an entire field of applied math called operations research that is dedicated to this type of simulation and analysis. 

