Path: utzoo!attcan!uunet!timbuk!cs.umn.edu!uc!tut.cis.ohio-state.edu!ucsd!pacbell.com!pacbell!m5!tma From: tma@m5.COM (Tim Atkins) Newsgroups: comp.object Subject: Re: How would you model this situation? Message-ID: <3937@m5.COM> Date: 28 Oct 90 06:19:04 GMT References: <16734@rouge.usl.edu> Reply-To: tma@m5.UUCP (Tim Atkins) Organization: Object Sciences Corp., Menlo Park, CA Lines: 56 In article <16734@rouge.usl.edu> pcb@cacs.usl.edu (Peter C. Bahrs) writes: >The Domain: Object-oriented with concurrency if needed, objects have > local state, behaviors > >The Problem: > Model an application where two things(people) ara each applying a >force(pulling) on another thing (ends of a rope). The acted upon >thing (the rope) breaks. > >So suppose I tell person1 to pull X amount. Should I model all of >the interactions at an application level and then send the rope and >person2 reactionary messages. Or should person1, who knows about a >rope (globally) tell the rope to adjust it self, which in turn must >tell person2 to adjust hisself. So if the rope breaks, how are the >references in person1 and person2 updated? Does the existing rope >references become forwarders to new part-rope objects? In summary, >are interactions managed external to objects or should this be >migrated inside the objects. > >Please post responses to the net. Well now, I would model such a thing a bit differently. Each person model might contain: what force is being applied to (reference to rope); what force is being applied (with direction); what force is being experienced (counter pull); perhaps acceleration detector stuff and correction if over some limit or some fixed distance from a known point is traversed. The rope model would contain: end data on agents attached and length of rope starting at end; total length of rope; force applied to each end; some model of rope stress limits. So, each agent would be instructed: grab rope set first model variable and inform rope of attachement; apply force OVER time set force variables for persons which get transmitted to rope; rope calculates stresses and resultant forces and transmits each end force to opposite end holder as long as it is intact; on separation rope computes break point and sets internal state; transmits change of force messages to end holders; end holders respond with acceleration and therefore velocity changes which they can respond to; each person or the rope itself could be queried directly or indirectly for how big their piece of rope is, there current acceleration, etc. Does this model seem reasonable? - Tim