- #1
Sojourner01
- 373
- 0
I have a problem in constructing a program. The principle is a monte carlo simulation tool using object-oriented (or, strictly I suppose, object-based) techniques written in Visual C#.
So far my object hierarchy is constructed as follows:
A Lattice class, which contains:
A 3-dimensional array of Site objects
A Site class, instances of which have:
two booleans to define whether they're i) valid in an FCC lattice ii) occupied by anything
A 3-dimensional array of other Site objects defining its neighbours
A Polymer class, which contains:
An array of Monomer objects
A Monomer class, instances of which have:
A Site object defining where they are
I have come to the conclusion that this system is a mess and doesn't define things in a way that can be acted on by Monte Carlo transformation methods I plan to implement. I've walled myself in here, and it's going to take a considerable amount of work to restructure this program to get it to work.
At the very least, I want to get the 'neighbours' array of each monomer to point to Site objects in the Lattice's array of sites. I'm not sure how to do this. I don't want to use lookup tables, since they're arbitrary and not very portable.
I appreciate that this topic is a bit of a mouthful, so please do inquire if - which will almost certainly be the case - my explanation is unclear or lacking.
So far my object hierarchy is constructed as follows:
A Lattice class, which contains:
A 3-dimensional array of Site objects
A Site class, instances of which have:
two booleans to define whether they're i) valid in an FCC lattice ii) occupied by anything
A 3-dimensional array of other Site objects defining its neighbours
A Polymer class, which contains:
An array of Monomer objects
A Monomer class, instances of which have:
A Site object defining where they are
I have come to the conclusion that this system is a mess and doesn't define things in a way that can be acted on by Monte Carlo transformation methods I plan to implement. I've walled myself in here, and it's going to take a considerable amount of work to restructure this program to get it to work.
At the very least, I want to get the 'neighbours' array of each monomer to point to Site objects in the Lattice's array of sites. I'm not sure how to do this. I don't want to use lookup tables, since they're arbitrary and not very portable.
I appreciate that this topic is a bit of a mouthful, so please do inquire if - which will almost certainly be the case - my explanation is unclear or lacking.