Newsgroups: rec.arts.int-fiction
Path: gmd.de!ira.uka.de!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!haven.umd.edu!uunet!comp.vuw.ac.nz!canterbury.ac.nz!huia!greg
From: greg@huia.canterbury.ac.nz (Greg Ewing)
Subject: Re: physics
Message-ID: <C5tF8J.9HL@cantua.canterbury.ac.nz>
Nntp-Posting-Host: huia.canterbury.ac.nz
Reply-To: greg@huia.canterbury.ac.nz (Greg Ewing)
Organization: University of Canterbury, Christchurch, New Zealand
References: <0foio9q00WBLA4lc9s@andrew.cmu.edu> <neilg.735341091@sfu.ca>
Date: Wed, 21 Apr 1993 04:02:43 GMT
Lines: 28

In article <neilg.735341091@sfu.ca>, neilg@fraser.sfu.ca (Neil K. Guy) writes:
|>  Another major problem that comes to mind is the perennial difficulty
|> in modelling infinitely divisible stuff.

I wrote a mini-adventure in TADS recently in which I dealt with exactly
this problem. My solution involved a class "substance" representing
something you can have varying amounts of, and a class "quantityHolder"
that knows how to contain varying amounts of different substances.

For example, you might have subtances "sand" and "water", and
quantityHolders "bottle" and "bucket".

Each quantityHolder has a list of [subtstance,amount] pairs representing
the amount of each substance it currently holds. Special methods of
quantityHolder are used to transfer specific amounts of substances
from one quantityHolder to another, etc., and various verbs such as
putIn are defined to do the appropriate things when applied to
substances and quantityHolders. There are also some new verbs
such as emptyInto which dumps the entire contents of one quantityHolder
into another.

I could post the source here if there was enough interest - or is there
another group that would be more appropriate?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of Japan Inc.|
greg@cosc.canterbury.ac.nz	   +--------------------------------------+
