I'm guessing
1. svn co <url-to-repo that google code displays for you>
2. make changes
3. commit changes
But then, I've never used google code before.
(Also, I gotta call you on the use of NP Hard; any links to papers
explaining why the AI problem is NP Hard?)
The only thing Java has over C# is its enumerations. (Oh how I wish for
overloadable operations on C# enums...)
Look in TestAI.txt for an explanation of the AI description language.
As usual, work in progress...
I'll see what I can do...
I do hope they get the zip issue sorted out, since otherwise there goes
our Anko archives again... I also hope they fix whatever it was that
was causing Firefox to end up in an infinite refresh loop...
As for actions, again, it's early days. I have plans to add if-then-else
blocks, let blocks, possibly some sort of looping construct (fixed
count, to ensure that it won't hang), etc. If you can think of anything
else you might foresee, functions and whatnot...
I've added to the action blocks, the following construct:
select (each|first) {
case <expresison> { actionblockstatementlist }
case <expression> { actionblockstatementlist }
...
}
As well as two other statements, break and continue.
Break breaks out of the select block entirely; continue continues with
evaluating the next case.
The each|first selector defines what the default behaviour is if you
fall out of a case block.
Each acts like a continue, thus every valid case will be executed unless
a break is encountered.
First acts like a break, thus only the first case which succeeds will be
executed, unless that case continues.
Tomorrow I intend to add if blocks, logical operators (which can
currently be represented with addition, multiplication, or subtraction
from 1), and let blocks.
Additions:
I've added let blocks, which let you define temporary variables for some
block of statements.
The variables are read-only within the blocks.
Variables may only be defined once per let block (unless it's a let*
block; see below).
They will shadow any previously defined variable outside the block's
scope, including other let variables.
There are two forms: let and let*
Both take the form of:
let[*] [binding list] { statements }
A binding list is a list of zero or more variable bindings:
variable = expression[, variable = expression [, ...]]
(Note that the binding list is entirely optional, though why you'd have
a let block without one is not clear to me...)
The difference between let and let* is that the block
let* x=1, y=2, z=3 { statement }
is functionally equivilent to
let x=1 {
let y=2 {
let z=3 {
statement
}
}
}
Thus, it is acceptable to write something like
let* x=1, x=x+3 {statement}
I've also added the following functions:
avg(x,y,...) Calculates the average of the list of arguments. Minimum 2
arguments.
erf(x) Calculates the error function of x. Uses a precomputed 20 term
Taylor expansion (which converges very quickly)
ierf(x) Calculates the inverse error function of x.
IErf uses a precomputed 500 term Taylor expansion, with checks to
ensure that it stops calculating after the numbers get too small to
matter. IErf(1) = 2.451305. For values outside the range of +/- 1,
IErf will return +/- infinity. It starts to lose accuracy at arounf
IErf(0.99), losing one point in the 5th decimal place, and rapidly
degrades after that.
if()
is a function, not a statement. if(x,y,z)
is the equivilent of C's (x?y:z)
. To get control flow
statements, use the select block. The equivilent of if (x) {
y;
}
select first {
case x {
y;
}
}
if (x1) {
y1;
} else if (x2) {
y2;
} else {
y3;
}
select first {
case x1 {y1;}
case x2 {y2;}
case 1 {y3;}
}
if (x1) {y1;}
if (x2) {y2;}
if (x3) {y3;}
is equivalent to select every {
case x1 {y1;}
case x2 {y2;}
case x3 {y3;}
}
action wait
and action
rest
. The action search is scheduled for the later of the start
of the last action search plus action wait
, or the end of
the last action plus action rest
. I haven't added any kind of external stimuli yet.
Stimulation acts like stat variables; they can be read from by defined
variables and written to by actions.
'stim' Identifier '=' Number [<Range Clause>] <Stim Type> ';'
The Range clause is optional, and if it is not present it will be
assumed to be 0 to 1.
The two available types are 'slider' and 'button'.
Slider is a slider from min to max.
Button is implemented as a check box; if it is checked, the value is
max. If it is cleared, the value is min. If the value is set in an
action to a value other than min or max, the checkbox is considered
inteterminent.
Defined variables can read from stimulus variables; however they will
only be updated while the simulator is running, and then only once
before each time slice starts running (so don't worry when the numbers
don't change while paused).
Yes, stims. Stimulation. User modifieable variables.
stim Test = 0 from 0 to 1 slider;
would be a slider from 0 to 1. There's also a button. (It's a checkbox
in the last upload, it'll be radio buttons on the next one.)