Object-Oriented philosophy problem

  • Thread starter Sojourner01
  • Start date
  • Tags
    Philosophy
In summary, the programmer is struggling to construct a program using object-oriented techniques and has run into difficulty with linking the neighbours array of a monomer to the Site objects in a Lattice class.
  • #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.
 
Technology news on Phys.org
  • #2
Can you explain a little bit better why you're having difficulties with setting the neighbours array to point to the neighbour sites on the Lattice? You can either have the Site class keep a reference to the parent Lattice, in which case it can use something likemyLattice.GetSite(mySite.X+1, mySite.Y+1, mySite.Z+1) to get neighbors, or you can have the Site constructor take in the array of neighbours as a parameter - and use a Factory model to instantiate Sites - the Lattice class would have a method GetSite(x, y, z) which instantiates a Site instance, populates the neighbours array and returns it.
 
  • #3
Apologies for my blind ignorance; I've realized in the last 24 hours how staggeringly simple my error was. There isn't a problem with saying array2[n] = array1[not necessarily n], when they're both arrays of references to the same object type. For some reason I conceptualise the = operator as assignment by value when it's really stating a link between reference and object.

My programming still a maze, s i may have to check back here for some more pearls of wisdom in tidying it up.
 

1. What is object-oriented philosophy?

Object-oriented philosophy is a philosophical approach that focuses on the relationships between objects and the ways in which they interact with each other. It is based on the idea that objects have a certain essence or nature that is independent of human perception and can be understood through their relationships with other objects.

2. What is the main problem with object-oriented philosophy?

The main problem with object-oriented philosophy is that it can be difficult to apply to abstract or intangible objects, such as ideas or emotions. This can lead to a limited understanding of these concepts and their relationships with other objects.

3. How does object-oriented philosophy differ from other philosophical approaches?

Object-oriented philosophy differs from other philosophical approaches in that it places a strong emphasis on the relationships between objects and their interactions, rather than focusing solely on individual objects or subjective experiences.

4. What are some potential solutions to the problems of object-oriented philosophy?

Some potential solutions to the problems of object-oriented philosophy include incorporating elements of other philosophical approaches, such as phenomenology or hermeneutics, and acknowledging the limitations of object-oriented thinking when it comes to abstract or intangible objects.

5. How can object-oriented philosophy be applied in practical contexts?

Object-oriented philosophy can be applied in practical contexts through various disciplines, such as psychology, sociology, and anthropology, to better understand the relationships between objects and their impact on society and individuals. It can also be used in design and engineering to create more efficient and effective systems based on the relationships between different components.

Similar threads

  • Programming and Computer Science
Replies
25
Views
3K
  • Programming and Computer Science
Replies
1
Views
931
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
10K
  • Programming and Computer Science
Replies
6
Views
5K
Replies
2
Views
626
  • Differential Geometry
Replies
4
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top