C++ class design for Monte Carlol simulation
问题 I'm trying to build a Monte Carlo object class and am wondering about the best way to design the relevant classes. The structure of the object (called Entity) contains name, description AND a Distribution type which can be of a few different types eg. Normal, Fixed Integer, Triangle etc. The Distribution class is (or might be) a superclass of the specific distributions eg. Normal. So, I have class Entity { public: string name; Distribution* dsn; // superclass. Can this be done? } class