names default to here(1);
dtResults = New Table( "Results",
Add Rows( 240 ),
New Column( "time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Mod( Row() - 1, 10 ) )
),
New Column( "humidity",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 30, 60, 10, 60 ) ),
Set Selected
),
New Column( "Bacteria Type",
Character,
"Nominal",
Value Labels( {"1" = "a", "2" = "b"} ),
Use Value Labels( 1 ),
Set Values( Repeat( {"b"},240) )
),
New Column( "magnitude",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( If( :time == 0, Random Uniform( 0.5, 1 ), Lag( :magnitude ) ) )
),
New Column( "temp",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 80, 90, 2, 10 ) )
),
New Column( "growthRate",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If( :time == 0,
0,
(1 - :time / (:time + 1)) * Ln( :time * 2 ) * :magnitude * :humidity
* :temp + Random Normal( 0, 100 )
)
)
)
);
dtRef = New Table( "Reference",
Add Rows( 10 ),
New Column( "time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Row() - 1 )
),
New Column( "growthRate",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
If( :time == 0,
0,
(1 - :time / (:time + 1)) * Ln( :time * 2 ) * 0.7 * 40 * 80
+Random Normal( 0, 100 )
)
)
),
New Column( "Bacteria Type",
Character,
"Nominal",
Set Selected,
Set Values( {"a", "a", "a", "a", "a", "a", "a", "a", "a", "a"} )
)
);
dtAll = New Table( "All Conditions",
Add Rows( 24 ),
New Column( "temp",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 80, 90, 2 ) )
),
New Column( "humidity",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 30, 60, 10, 6 ) ),
Set Selected
),
Set Row States(
[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
)
);
wait(1);
dtRefAll = dtRef << Join(
With( dtAll ),
Cartesian Join,
Copy formula(1)
);
dtRefAll << Set Name( "All Reference Data" );
dtForGraph = dtResults << Concatenate( dtRefAll, Keep Formulas );
dtForGraph << Set Name("For Graphing");
dtForGraph << Graph Builder(
Size( 676, 633 ),
Show Control Panel( 0 ),
Variables(
X( :time ),
Y( :growthRate ),
Group X( :temp ),
Group Y( :humidity ),
Overlay( :Bacteria Type )
),
Elements( Points( X, Y, Legend( 10 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
10,
Properties( 0, {Line Color( 32 )}, Item ID( "a", 1 ) ),
Properties( 1, {Line Color( 56 )}, Item ID( "b", 1 ) )
)}
),
Dispatch( {}, "400", LegendBox, {Set Title( "Bacteria" )} )
)
);