A non-transitory computer readable recording medium storing a simulation program for causing a computer to execute a simulation of a state of one or more workpieces supplied by a workpiece supply part, wherein the simulation program causes the computer to execute:
- a step of calculating a state of a workpiece conveyance device including the workpiece supply part when a start of a simulation is instructed;
- a step of calculating, by physical simulation, an external force applied to each of the workpieces reflecting an influence of a collision with other workpieces based on the state of the workpiece conveyance device;
- a step of calculating and updating, every predetermined time interval, a position and a posture of each of the workpieces disposed in a virtual space based on a trajectory of each of the plurality of workpieces according to mass of the each of the workpieces and the calculated external force;
- a step of carrying out a measurement on a virtual image generated by imaging the virtual space by a virtual camera disposed at an arbitrary viewpoint position in the virtual space, and generating an operation command to a robot based on a measurement result obtained by the measurement;
- a step of calculating, based on the operation command, a position and a posture of the robot conveying the workpieces disposed in the virtual space, determining whether or not the calculated position and posture of the robot is in a predetermined state, and setting the target workpiece to a pick state or a place state when the calculated position and posture of the robot is in the predetermined state;
- and
- a step of generating an image in which the virtual space is visualized based on information of the position and the posture of each of the workpieces and information of the position and the posture of the robot.