The promotion of space sharing in order to raise the quality of community living and safety of street surroundings is increasingly accepted feature of modern urban design. In this context, the development of a shared space simulation tool is essential in helping determine whether particular shared space schemes are suitable alternatives to traditional street layouts. A simulation tool that enables urban designers to visualise pedestrians and cars trajectories, extract flow and density relation in a new shared space design, achieve solutions for optimal design features before implementation, and help getting the design closer to the system optimal. This paper presents a three-layered microscopic mathematical model which is capable of representing the behaviour of pedestrians and vehicles in shared space layouts and it is implemented in a traffic simulation tool. The top layer calculates route maps based on static obstacles in the environment. It plans the shortest path towards agents' respective destinations by generating one or more intermediate targets. In the second layer, the Social Force Model (SFM) is modified and extended for mixed traffic to produce feasible trajectories. Since car movements are not as flexible as pedestrian movements, velocity angle constraints are included for cars. The conflicts described in the third layer are resolved by rule-based constraints for shared space users. An optimisation algorithm is applied to determine the interaction parameters of the force-based model for shared space users using empirical data. This new three-layer microscopic model can be used to simulate shared space environments and assess, for example, new street designs.