[
Lists Home |
Date Index |
Thread Index
]
Such type of problems are generally solved by the "iter" and "iterUntil"
templates of FXSL.
"iter" iterates a function a given number of times. "iterUntil" iterates a
function until some condition (constraint) has been met.
The solution is natural and reflects a well-formulated and well-understood
problem.
The "within" template can be used to capture "converging" behaviour. It
iterates a given function until the difference between two consecutive
results becomes less than a given range.
There are many examples, demonstrating the use of these templates in FXSL.
They have been successfully used to solve many problems of this kind.
A solution to your problem will be straightforward once the "step-function"
and the "constraining function" have been precisely defined.
I would be glad to help -- please, do not hesitate to contact me.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Roger L. Costello" <costello@mitre.org> wrote in message
3F89B9C0.4570554A@mitre.org">news:3F89B9C0.4570554A@mitre.org...
> Hi Folks,
>
> I would like to see if collectively we can create a complex system
> using XSLT. Several people have been hinting at doing this.
> Now let's do it!
>
> I thought that a good first step in building a complex system would be
> to learn how to create "feedback". Let me start by defining feedback.
>
> Suppose that the "system" is a Fitness Center. Let's see how feedback
> may enter into a Fitness Center system:
>
> 1. New people join the Fitness Center.
> + +> 2. This results in increased revenue. With the new money
> + the Fitness Center purchases more equipment.
> + 3. The new equipment attracts more people to join. +
> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
>
> This feedback loop is "amplifying" (increasing):
> - the number of members
> - the total revenue of the Fitness Center
> - the amount of equipment.
>
> This is called "positive feedback". Positive feedback means that big
> things have a tendency to get even bigger, e.g., big Fitness Centers
> get bigger, big newspapers get bigger, etc.
>
> The amplification will reach a steady state once the Fitness Center has
> as much equipment and members as it can hold, given the size of the
> building they are in. Thus, the size of the building imposes a
> "negative feedback" on the system, keeping it from expanding
> indefinitely.
>
> The initial stimulus which resulted in the system entering into the
> feedback loop was that some new people joined the Fitness Center.
> A small change in the system resulted in a big overall change;
> aka The Butterly Effect.
>
> Now let's relate this to XML and XSLT. The Fitness Center is
> modelled using XML:
>
> <FitnessCenter>
> <Members>
> <Member level="platinum">
> <Name>Jeff</Name>
> <MembershipFee>$500</MembershipFee>
> </Member>
> <Member level="gold">
> <Name>Stacey</Name>
> <MembershipFee>$350</MembershipFee>
> </Member>
> ...
> </Members>
> <TotalRevenue>$75,000</TotalRevenue>
> <Equipment>
> <Item>Cybex Leg Extension</Item>
> <Item>Hammer Strength Lat Row</Item>
> ...
> </Equipment>
> </FitnessCenter>
>
> How can we design our XSLT stylesheet to exhibit feedback? One
> thought might be to create a stylesheet which "simulates" the growth of
> the Fitness Center:
>
> FitnessCenter.xml --> FitnessCenter.xsl --> newFitnessCenter.xml
> Parameter: New Members List
>
> The stylesheet inputs the FitnessCenter XML document along with a
> stylesheet parameter that contains a list of new members. The
> stylesheet then simulates the feedback loop by generating new
> <Equipment> items, which then results in creating new <Member>
> elements, which results in generating new <Equipment> items,
> which then results in creating new <Member> elements, etc. The
> output XML document shows an updated Fitness Center with more
> members, a larger total revenue, and more equipment.
>
> However, I don't feel that such a "simulation stylesheet" would be a
> good example of feedback for this reason:
>
> - XSLT is not really a simulation language. If the purpose is to
> run a simulation then it would probably be better to use a
> language explicitly designed for simulations.
>
> So how can we write a stylesheet which exhibits feedback and takes
> advantage of what XSLT is good at - processing XML documents?
> Answer: I don't know. I am hoping that collectively we can arrive
> at a good example.
>
> Here are some thoughts: the above example shows the feedback loop
> amplifying the member count, the total revenue, and the equipment
> count. Perhaps that's the wrong thing to focus upon. That is focusing
> upon the Fitness Center. Perhaps instead the focus should be on the
> stylesheet itself. Perhaps some aspect of the stylesheet should get
> amplified, e.g., perhaps the output of the stylesheet is another
> sylesheet which is "amplified" with more template rules. I don't know.
> I have run into a wall. I am hoping that someone can help me to be
> break through the wall and see the light. /Roger
>
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>
>
|