[AccessD] Aquarium Life
John W. Colby
jwcolby at gmail.com
Wed Mar 4 11:49:30 CST 2015
The concept of setting ranges and then filtering for matching fish is
dead simple. That is not a complete solution however.
Unfortunately users usually want to come at it from "I like this fish
and this fish and that fish and... rats... I just killed that fish..."
That does make the idea of setting up combos or text boxes to allow
entering the min / max for each property, and then seeing what falls in
the range a good idea. I think I will use that method. I could then
add some method of selecting a specific fish and getting feedback on
what property of the selected fish does not match the range.
IMO, the correct way to set up an aquarium is to decide the fish,
balance the water to a point that is acceptable to all the fish (thus
the original question) and then introduce the fish one breed at a time,
timid to aggressive.
Eventually I do in fact have to get the min / max that is acceptable
for ALL the fish in the selection. You may get specific fish
combinations that require a rather narrow range of min / max for some or
all the properties. Thus the water has to be in that range or some
species is stressed or dies.
I think it is relatively trivial to get the min / max values with SQL
over a range of records. If those records are the already selected fish
then it self adjusts as you add the next fish. Thus select the fish
that will work in a base range, then look at the query that selects the
min / max over the selected fish. In fact if that min/max query was
placed in a subform (or query) in the footer of a form and requeried as
fish were added in the main area, You could see the existing min/max
over the already selected and use that to guide you in selecting the
next fish. You could even use the min/max query to filter the combo of
what fish is still available to be selected.
Another consideration is the "inches of fish" allowed in the tank. The
rule of thumb is one inch / gallon. If the aquarium is a 50 gallon
tank. as you select fish you get the max (adult) length, and then add a
quantity, you end up with a selected number of inches. That has to be
summed, and the sum not to exceed the tank capacity. Just another
limiting factor to be checked as you go, or as you adjust the quantities
of each selected fish.
You can see that, done correctly, you could set up your tank, and as
fish are added or die, you could tweak the numbers to see where you
stand and what could be added back in. The current aquarium (fish)
statistics are stored and available on demand. As you test your water
you can then check back against the stored statistics to make sure that
the properties still fall within the acceptable ranges.
I told ya this would turn into database work.
John W. Colby
On 3/4/2015 11:45 AM, Arthur Fuller wrote:
> Jim,
>
> While your assertion is correct in an algiorythmic sense, I fear that it
> overlooks some complexities, not to mention some serious difficulties in
> the UI-aspect of the problem.
>
> But I do find this an interesting problem, and have turned JWC's content
> into an Accdb file so I can begin some experiments.
>
> I'm a tad unclear on a couple of scenarios:
>
> a) given a selection of n fish thus far, all conforming to a given set of
> parameters p, then are we limited to adding fish that fall within p, or are
> we also allowed to add a new fish which might stretch the parameters, but
> accidentally preclude some of the previously-chosen fish?
>
> b) a far simpler version might initially specify the parameters and then
> seek which fish can live within them, then maybe change a parameter or two
> and repeat, until some desired optimum is reached. Said optimum would have
> to be defined beforehand; some possibilities include Max. # of fish within
> a given price-range, or Max # of fish varieties regardless of cost. Just a
> couple of examples; I'm sure there are many more.
>
> An interesting problem.
>
> A.
>
More information about the AccessD
mailing list