[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Handling equations as objects
From: |
Miles Parker |
Subject: |
Re: Handling equations as objects |
Date: |
Fri, 21 Aug 1998 12:09:20 -0400 |
Miles T. Parker mailto:address@hidden
Research Software Engineer 202.797.6136
The Brookings Institution fax 202.797.6319
1775 Massachusettes Avenue, N.W., Washington, D.C. 20036
>>> Jayshree Sarma <address@hidden> 08/21 11:10 AM >>>
Yes, the functional form of the equation can change. Also
the number of terms in the equation can increase/decrease. The
values of the parameters/coefficients can also change.
In this case, using my code for context (sorry I'm speaking a different
language!), you simply create various subclasses for each functional form, and
then instantiate them and assign them to agents or collections of agents as
appropriate. It might even be useful to create ready instatiations of these (or
even a factory class or method) so that you could simply set the appropriate
function for a given agent, but you wouldn't have to instantiate for each
agent, e.g.:
*****
public class MyAgent {
private Function function;
public static final FUNCTION_FORM_1 = new FunctionForm1();
public static final FUNCTION_FORM_2 = new FunctionForm2();
public void setFunction(Function function) {
this.function = function;
}
}
*****
myAgent.setFunction(Agent.FUNCTION_FORM_1);
Of course, you would have to change the example significantly to support
changing numbers of parameters...you'd might provide setters for everything
(perhaps with some mechanism for distinguishing parameters from terms) and some
no parameter solve method, OR...better, you might just create a "ParamaterSet"
class that would support n dimensions.
-Miles
================================= Swarm-Support is for
discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
================================
- Re: Handling equations as objects, (continued)
- Re: Handling equations as objects, Paul Johnson, 1998/08/20
- Re: Handling equations as objects, Pietro Terna, 1998/08/20
- Re: Handling equations as objects, Jayshree Sarma, 1998/08/21
- Re: Handling equations as objects, Pietro Terna, 1998/08/21
- Swarm on Mac Problems, Perrone Alessandro, 1998/08/24
- Re: Swarm on Mac Problems, Marcus G. Daniels, 1998/08/24
- Re: Swarm on Mac Problems, Perrone Alessandro, 1998/08/25
- Re: Swarm on Mac Problems, Marcus G. Daniels, 1998/08/25
Re: Handling equations as objects,
Miles Parker <=
Re: Handling equations as objects, Miles Parker, 1998/08/21
Re: Handling equations as objects, Miles Parker, 1998/08/21