[From Bill Powers (2004.03.31.0751 MST)]
Bill Williams 30 March 2004 11:10 PM CST --
Are you getting interested in what can be done with
Delphi?
>
If you mean, am I getting interested in switching to Delphi as my primary
programming compiler, the answer is an emphatic no.
I can fully sympathize with that. Dag is always trying to tempt me into
trying some new program, and I resist loudly because I dread the learning
period and don't have the time for it anyway.
The only problem is, as I wrote to Rick just now, that Turbo Pascal isn't
going to run on the newer operating systems if you use any graphics, and
maybe not even in text mode. Maybe that will be fixed, but Microsoft is not
known for making it easy to use older software. They call it "legacy"
software, a sneer at everyone who is so old-fashioned as to use hardware or
software that came out more than three years ago (it seems).
Delphi programming is Turbo Pascal with Windows extensions. The main change
is that it is "event-driven", meaning that the main procedures are
triggered by things you do to "controls" on the screen. Fortunately, there
is an "idle" event that happens every time nothing else is happening. It
can be used to establish a "heartbeat" that calls a program at intervals
you can set (to the nearest microsecond or better!), and this can be used
to run iterative simulations written in very nearly the way we write them now.
One of the great features is that when you start Delphi, it comes up with a
Unit and a Form already set up -- and you can type F9 to compile and run
it. It won't do anything except let you minimize or close the window, but
you start out with a running program to which you can add your own
programming. The Unit is just like a Pascal Unit (and the Editor is just
like the old Pascal editor), and the Form is an image of the screen you
will see when the program runs. You can drag "controls" from a menu onto
the Form, like that button labeled Pause. Double-click the button, and the
compiler switches to the Editor with a blank procedure that, at run-time,
will be called every time you click the button. You just write in the
Pascal program you want to be executed, between the Begin and End.. That
program can call other procedures and functions you have written into the
Implementation part of the Unit, so this is the door into any kind of
programming you want to do.
The commands in the Editor are the same old WordStar commands that have
been in Turbo Pascal since the first version, plus others you can use if
you like. To do a search and replace I still type control-Q-A, and Find is
control-Q-F. Control-Y deletes a line, and so on. Brings a tear to the eye
-- I learned that stuff in about 1975.
I am with you in hating all modern computing languages, which require you
to devote 90% of your time to figuring out how to get the damned language
to do what you want, and then make you do it the way some snot-nosed baby
genius thinks you ought to do your programming. But hey, that's progress.
Anyway, Delphi is fairly unobtrusive in that regard, though it still thinks
that multi-tasking is the bees knees, and Windows assumes that 200 people
are going to be using your computer. I think we'll just have to get used to
it, if we want other people to be able to run our programs. It's not their
fault.
One other thing. If you acquire Delphi, you can use it even before
understanding it to compile and run source code, which can be sent back and
forth as ASCII text, even embedded in an email post. Only three small files
need to be sent, and you open just one of then, the .dpr or project file,
by using File|Open in Delphi. Hit F9, and it compiles and runs. I wouldn't
try using it on the laptop you have, however. Too slow, not enough memory.
You could start making your own changes to the program right away, even
before you start learning the special Delphi stuff.There are certainly
things to learn, but I think you would very quickly get back to the level
of programming you're now doing. And your programs would run on all new
machines until Gates decides to screw us again. But then there will be new
versions of Delphi, whereas Turbo Pascal 7.0 is the last version there will
ever be. When nobody uses Windows 98 any more, nobody will be able to run
your programs.
Re: Econ005:
As to "maximizing" agents, they would be easy to add (if you know what you
want to add) since the agents are programmed separately from the "test bed"
part, which is the lower part of the diagram. I think we need to flesh out
the test bed first, making a provision for investment to maintain and alter
productivity (called "efficiency" in Econ005), and for banks to create and
lend money at specified interest rates, and a not-for-profit sector (which
includes government) to redistribute money.We may want a plant that makes
only capital goods and sells to the other plant (while paying its workers
and doing capital distributions just as the other plant does),
Also, we may want to add a few more agents. For example, we may want to
split the capital-income consumer into an owner and a non-owner, so the
owner can be the one who receives profits and also who (as CEO or board of
directors) decides the policies to be followed by plant managers. I think
it's reasonable to have a manager-agent who controls inventory by adjusting
prices, but we also need an employer-agent who hires and fires, and
probably a level above those guys, an agent who sets limits on employment
and price changes, with an eye on the return on investment -- this one
might be an owner-consumer as well. Or maybe just a bean-counter.
So there is still a lot of experimenting to do. I don't think we want to
add unnecessary complications just because we can, but there's some minimum
amount of detail that's needed to make the model realistic enough for
present purposes. No doubt our aims will change with experience.
By the way, I thought of a useful way to introduce the model. Instead of
saying that it's a model of "the" economy, or the "US" economy, we should
just say it's a model of AN economy, whatever economy would result from
having agents and interactions in it of the type we have proposed. The
point is to keep proposing components and altering components until this
model economy begins to behave in ways similar to the economy we want to
imitate. We're not simply trying to imitate _behavior_. We're proposing an
underlying organization which will behave according to the properties we
give, and in the end, if we succeed, like the real system we're trying to
understand.
I'm thinking about your comments on the time problem. Keep reminding me,
and I'll try to come up with something useful. There may be more to the
concept of simulation than just the method of handling time, but that is
certainly one of the basic points.
Your suggestion about making the numbers on the bar-charts larger conflicts
with my reason for putting them where they are -- looking ahead to having a
lot more of these bar-charts on the screen at the same time, as we add
agents and sectors. I still worry about that, and suggestions are needed.
Of course I could put bigger numbers somewhere else in the present version,
but what happens when we add five more sets of plots to the screen? It's
going to be a mess unless we can think of some better way to do the plots.
Actually, it should be possible to work with a window much larger than the
display screen. When you do that, the part of the window that will fit is
shown, and there will be scroll bars on the right side and bottom, which
can be used to move the viewing area around in the large window. The scroll
bars show up automatically when you set the window size to be larger than
the display screen. Hmm. Well, we have lots of things to work on, from the
model itself to the way it's shown and used on the screen.
By the way, did you notice that I distributed your two program files as
zipped attachments? Maybe you didn't see that post. We need that writeup,
although of course I wouldn't dream of telling you what to do.
Best,
Bill P.