redshift 1.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. data/.gitignore +8 -0
  2. data/README +5 -0
  3. data/RELEASE-NOTES +455 -0
  4. data/TODO +431 -0
  5. data/bench/alg-state.rb +61 -0
  6. data/bench/bench +26 -0
  7. data/bench/bench.rb +10 -0
  8. data/bench/continuous.rb +76 -0
  9. data/bench/diff-bench +86 -0
  10. data/bench/discrete.rb +101 -0
  11. data/bench/euler.rb +50 -0
  12. data/bench/formula.rb +78 -0
  13. data/bench/half-strict.rb +103 -0
  14. data/bench/inertness.rb +116 -0
  15. data/bench/queue.rb +92 -0
  16. data/bench/run +66 -0
  17. data/bench/simple.rb +74 -0
  18. data/bench/strictness.rb +86 -0
  19. data/examples/ball-tkar.rb +72 -0
  20. data/examples/ball.rb +123 -0
  21. data/examples/collide.rb +70 -0
  22. data/examples/connect-parallel.rb +48 -0
  23. data/examples/connect.rb +109 -0
  24. data/examples/constants.rb +27 -0
  25. data/examples/delay.rb +80 -0
  26. data/examples/derivative.rb +77 -0
  27. data/examples/euler.rb +46 -0
  28. data/examples/external-lib.rb +33 -0
  29. data/examples/guard-debugger.rb +77 -0
  30. data/examples/lotka-volterra.rb +33 -0
  31. data/examples/persist-ball.rb +68 -0
  32. data/examples/pid.rb +87 -0
  33. data/examples/ports.rb +60 -0
  34. data/examples/queue.rb +56 -0
  35. data/examples/queue2.rb +98 -0
  36. data/examples/reset-with-event-val.rb +28 -0
  37. data/examples/scheduler.rb +104 -0
  38. data/examples/set-dest.rb +23 -0
  39. data/examples/simulink/README +1 -0
  40. data/examples/simulink/delay.mdl +827 -0
  41. data/examples/simulink/derivative.mdl +655 -0
  42. data/examples/step-discrete-profiler.rb +103 -0
  43. data/examples/subsystem.rb +109 -0
  44. data/examples/sync-deadlock.rb +32 -0
  45. data/examples/sync-queue.rb +91 -0
  46. data/examples/sync-retry.rb +20 -0
  47. data/examples/sync.rb +51 -0
  48. data/examples/thermostat.rb +53 -0
  49. data/examples/zeno.rb +53 -0
  50. data/lib/accessible-index.rb +47 -0
  51. data/lib/redshift.rb +1 -0
  52. data/lib/redshift/component.rb +412 -0
  53. data/lib/redshift/meta.rb +183 -0
  54. data/lib/redshift/mixins/zeno-debugger.rb +69 -0
  55. data/lib/redshift/port.rb +57 -0
  56. data/lib/redshift/queue.rb +104 -0
  57. data/lib/redshift/redshift.rb +111 -0
  58. data/lib/redshift/state.rb +31 -0
  59. data/lib/redshift/syntax.rb +558 -0
  60. data/lib/redshift/target/c.rb +37 -0
  61. data/lib/redshift/target/c/component-gen.rb +1303 -0
  62. data/lib/redshift/target/c/flow-gen.rb +325 -0
  63. data/lib/redshift/target/c/flow/algebraic.rb +85 -0
  64. data/lib/redshift/target/c/flow/buffer.rb +74 -0
  65. data/lib/redshift/target/c/flow/delay.rb +203 -0
  66. data/lib/redshift/target/c/flow/derivative.rb +101 -0
  67. data/lib/redshift/target/c/flow/euler.rb +67 -0
  68. data/lib/redshift/target/c/flow/expr.rb +113 -0
  69. data/lib/redshift/target/c/flow/rk4.rb +80 -0
  70. data/lib/redshift/target/c/library.rb +85 -0
  71. data/lib/redshift/target/c/world-gen.rb +1370 -0
  72. data/lib/redshift/target/spec.rb +34 -0
  73. data/lib/redshift/world.rb +300 -0
  74. data/rakefile +37 -0
  75. data/test/test.rb +52 -0
  76. data/test/test_buffer.rb +58 -0
  77. data/test/test_connect.rb +242 -0
  78. data/test/test_connect_parallel.rb +47 -0
  79. data/test/test_connect_strict.rb +135 -0
  80. data/test/test_constant.rb +74 -0
  81. data/test/test_delay.rb +145 -0
  82. data/test/test_derivative.rb +48 -0
  83. data/test/test_discrete.rb +592 -0
  84. data/test/test_discrete_isolated.rb +92 -0
  85. data/test/test_exit.rb +59 -0
  86. data/test/test_flow.rb +200 -0
  87. data/test/test_flow_link.rb +288 -0
  88. data/test/test_flow_sub.rb +100 -0
  89. data/test/test_flow_trans.rb +292 -0
  90. data/test/test_inherit.rb +127 -0
  91. data/test/test_inherit_event.rb +74 -0
  92. data/test/test_inherit_flow.rb +139 -0
  93. data/test/test_inherit_link.rb +65 -0
  94. data/test/test_inherit_setup.rb +56 -0
  95. data/test/test_inherit_state.rb +66 -0
  96. data/test/test_inherit_transition.rb +168 -0
  97. data/test/test_numerics.rb +34 -0
  98. data/test/test_queue.rb +90 -0
  99. data/test/test_queue_alone.rb +115 -0
  100. data/test/test_reset.rb +209 -0
  101. data/test/test_setup.rb +119 -0
  102. data/test/test_strict_continuity.rb +410 -0
  103. data/test/test_strict_reset_error.rb +30 -0
  104. data/test/test_strictness_error.rb +32 -0
  105. data/test/test_sync.rb +185 -0
  106. data/test/test_world.rb +328 -0
  107. metadata +204 -0
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ *.bck
2
+ pkg
3
+ doc
4
+ junk/*
5
+ tmp/*
6
+ tmp
7
+ */tmp
8
+ */junk
data/README ADDED
@@ -0,0 +1,5 @@
1
+ To install:
2
+
3
+ ruby install.rb config
4
+ ruby install.rb setup
5
+ ruby install.rb install
data/RELEASE-NOTES ADDED
@@ -0,0 +1,455 @@
1
+ redshift 1.3.15
2
+
3
+ - added dependency on cgen
4
+
5
+ redshift 1.3.14
6
+
7
+ - added rakefile and bones-based tasks
8
+
9
+ - added some examples
10
+
11
+ - Safer handling of C expressions using parens on RHS.
12
+
13
+ - Removed enum/op dependency.
14
+
15
+ - Small doc and comment changes.
16
+
17
+ - Cleaned up examples.
18
+
19
+ - Component#transition checks that operands are states.
20
+
21
+ - Fixed connect strict test.
22
+
23
+ - Fixed test_queue.rb on x86-64.
24
+
25
+ - Fixed CFLAGS for x86-64 in bench/formula.rb.
26
+
27
+ redshift 1.3.13
28
+
29
+ - Added test in test_discrete.
30
+
31
+ redshift 1.3.12
32
+
33
+ - Fixed bug with explicitly assigning an array to a
34
+ delay buffer.
35
+
36
+ - Raise if time_step changes while using delay.
37
+
38
+ redshift 1.3.11
39
+
40
+ - Expressions can refer to module constants
41
+
42
+ - More bits reserved for transition index.
43
+
44
+ redshift 1.3.10
45
+
46
+ - Varying time-step works.
47
+
48
+ redshift 1.3.9
49
+
50
+ - This works: connect :foo => nil
51
+
52
+ - Added test_connect_parallel.rb.
53
+
54
+ redshift 1.3.8
55
+
56
+ - Ports can be connected in parallel with resets.
57
+
58
+ - Component#inspect, when called during a transition, shows the
59
+ transition destination and the exported events and values.
60
+
61
+ - Link resets accept literal nil value.
62
+
63
+ redshift 1.3.7
64
+
65
+ - Link resets can be expressions.
66
+
67
+ redshift 1.3.6
68
+
69
+ - All expressions can include "lnk.lnk" terms.
70
+
71
+ redshift 1.3.5
72
+
73
+ - Component.strict sets strict independently of var declaration.
74
+
75
+ - Component#dest= changes the dest state during a transition.
76
+
77
+ - Added examples/{scheduler.rb,set-dest.rb}.
78
+
79
+ redshift 1.3.4
80
+
81
+ - Reset exprs can refer to events and linked events.
82
+
83
+ - Improved examples/collide.rb.
84
+
85
+ - Added examples/{sync-deadlock.rb,reset-with-event-val.rb}.
86
+
87
+ redshift 1.3.3
88
+
89
+ - Failed syncs are followed by attempts to continue evaluating further
90
+ transitions.
91
+
92
+ - Fixed bug: sync clause did not clear strict flag. Bug was also causing
93
+ bench/discrete.rb to report incorrect results.
94
+
95
+ redshift 1.3.2
96
+
97
+ - Clear discrete_step and zeno_counter at end of discrete_update.
98
+
99
+ - Component#inspect arg is a hash of options.
100
+
101
+ redshift 1.3.1
102
+
103
+ - Events have values throughout discrete step, excluding guard and sync.
104
+ (Incompatible change.)
105
+
106
+ - Removed event guards (since events do not have values during guard).
107
+ (Incompatible change.)
108
+
109
+ - Fixed bug with 'start Exit'.
110
+
111
+ redshift 1.2.41
112
+
113
+ - Added sync clause to transitions, for unambiguous synchronization.
114
+
115
+ - Improved message for reset type error.
116
+
117
+ - Link vars can now be declared without a type (defaults to Component).
118
+
119
+ - Fixed Queue behavior when #unpop called with SimultaneousQueueEntries.
120
+
121
+ - Added examples and tests.
122
+
123
+ redshift 1.2.40
124
+
125
+ - Improved test and bench for queues.
126
+
127
+ redshift 1.2.39
128
+
129
+ - Queue optimization: sleep when all guards waiting for queues.
130
+
131
+ redshift 1.2.38
132
+
133
+ - Minor changes to queue test, bench, and example code.
134
+
135
+ redshift 1.2.37
136
+
137
+ - Updated ZenoDebugger and examples/zeno.rb to work with ver 1.2 discrete step.
138
+
139
+ redshift 1.2.36
140
+
141
+ - Added queues.
142
+
143
+ redshift 1.2.35
144
+
145
+ - Replaced nr.random with sci/random and isaac in tests.
146
+
147
+ redshift 1.2.34
148
+
149
+ - Added examples/ports.rb.
150
+
151
+ - Brought hooks in world-gen.rb up to date.
152
+
153
+ - Fixed bug in euler flow introduced in 1.2.26.
154
+
155
+ redshift 1.2.33
156
+
157
+ - Refactored input variable evaluation into rs_eval_input_var().
158
+
159
+ redshift 1.2.32
160
+
161
+ - Minor refactoring and new tests related to previous.
162
+
163
+ redshift 1.2.31
164
+
165
+ - Flows and other expressions can refer to link.input_var.
166
+
167
+ redshift 1.2.30
168
+
169
+ - Fixed rs_raise() for non-AugmentedExceptions.
170
+
171
+ redshift 1.2.29
172
+
173
+ - Improved checking on strict inputs.
174
+
175
+ redshift 1.2.28
176
+
177
+ - Input ports can be connected to input ports.
178
+
179
+ - Added examples/subsystem.rb.
180
+
181
+ redshift 1.2.27
182
+
183
+ - Algebraic circularity checking no longer breaks when other exceptions happen.
184
+
185
+ - Exceptions during the execution of a simulation carry an object with them
186
+ which can be inspected later.
187
+
188
+ - Most exceptions raised from C code use the new rs_raise() function.
189
+
190
+ redshift 1.2.26
191
+
192
+ - Moved globals into World for thread safety, reentrancy, etc.
193
+
194
+ redshift 1.2.25
195
+
196
+ - The world accessor of Component is now stored internally as World shadow
197
+ instead of World object, to make access to World fields easier.
198
+
199
+ redshift 1.2.24
200
+
201
+ - Added input variables, connect, and ports.
202
+
203
+ - Added Library#declare_external_constant (see examples/external-lib.rb).
204
+
205
+ redshift 1.2.23
206
+
207
+ - Added examples/ball-tkar.rb.
208
+
209
+ redshift 1.2.22
210
+
211
+ - Derive flows have an option for feedback and the var_init_rhs setter.
212
+
213
+ - Read RUBY_SOURCE_FILE env var as alternative for library name (for IDE).
214
+
215
+ redshift 1.2.21
216
+
217
+ - Fixed another bug in delay of algebraic flows.
218
+
219
+ redshift 1.2.20
220
+
221
+ - Fixed bug in delay of algebraic flows.
222
+
223
+ - Improved interaction between euler flow and derive and rk4 flows.
224
+
225
+ redshift 1.2.19
226
+
227
+ - Fixed roundoff problem with variable delay (new fix).
228
+
229
+ - Fixed bug with delay of numerically integrated signal.
230
+
231
+ redshift 1.2.18
232
+
233
+ - Fixed bug in Flow#translate with reusing the optional formula string.
234
+
235
+ - Some improvements in error reporting.
236
+
237
+ - Fixed roundoff problem with variable delay.
238
+
239
+ redshift 1.2.17
240
+
241
+ - Added examples/simulink/delay.mdl and error comparison code in
242
+ examples/delay.rb.
243
+
244
+ redshift 1.2.16
245
+
246
+ - Fixed bugs with delay flow and transition between 2 states.
247
+
248
+ redshift 1.2.15
249
+
250
+ - Derivative flows can be arbitrary expressions.
251
+
252
+ - Improved accuracy of numerical differentiation.
253
+
254
+ redshift 1.2.14
255
+
256
+ - Delay flows can be arbitrary expressions (as can the delay term).
257
+
258
+ redshift 1.2.13
259
+
260
+ - Fixed RedShift module scoping problem.
261
+
262
+ - Delay flows can dynamically change their delay.
263
+
264
+ redshift 1.2.12
265
+
266
+ - Fixed bug with delay defined by a constant attr.
267
+
268
+ redshift 1.2.11
269
+
270
+ - Added delay flows (for delay constant).
271
+
272
+ - Added test/test_buffer.rb and examples/delay.rb.
273
+
274
+ - Refactored flow files into c/flow/ subdir.
275
+
276
+ redshift 1.2.10
277
+
278
+ - Guards can now be one of: true, false, nil. Added tests for this..
279
+
280
+ - Fixed examples to work with new redshift and plotting interface.
281
+
282
+ redshift 1.2.9
283
+
284
+ - Added examples/external-lib.rb and some support code.
285
+
286
+ redshift 1.2.8
287
+
288
+ - Added test for derivative.
289
+
290
+ - Added examples/simulink/derivative.mdl.
291
+
292
+ redshift 1.2.7
293
+
294
+ - Changed Euler flow to operate at rk=1 rather than rk=2.
295
+
296
+ - Fixed bug introduced in 1.2 that was exposed by the above change.
297
+
298
+ - Added derivative and PID control examples.
299
+
300
+ - Added euler flow benchmark and example.
301
+
302
+ redshift 1.2.6
303
+
304
+ - Added flow class for numerical differentiation (derive " rate = u' ").
305
+
306
+ - Cleaned up flow C code output.
307
+
308
+ redshift 1.2.5
309
+
310
+ - Fixed MSVC6 compiler snags.
311
+
312
+ - Optimization to reuse guard expr wrappers when exprs are the same. Same
313
+ for reset expr wrappers.
314
+
315
+ redshift 1.2.4
316
+
317
+ - Fixed World.open when it is called before World.new has been called.
318
+
319
+ - Minor doc cleanup and test additions.
320
+
321
+ redshift 1.2.3
322
+
323
+ - Fixed a bug in step_continuous introduced with the "diff_list" optimization.
324
+
325
+ redshift 1.2.2
326
+
327
+ - Added post actions.
328
+
329
+ - Fixed bug with "checked" flag and added a test.
330
+
331
+ - Fixed bug: alg flows must be uncached before check_strict.
332
+
333
+ redshift 1.2.1
334
+
335
+ - Revised structure of discrete step. May break some code.
336
+
337
+ redshift 1.1.59
338
+
339
+ - Optimization: use diff_list in step_continuous to scan just those components
340
+ that have diff flows.
341
+
342
+ - Improved bechmark framework and outputs; added new benchmarks.
343
+
344
+ redshift 1.1.58
345
+
346
+ - Event values may now be C exprs. Use #literal to force literal string/proc.
347
+
348
+ redshift 1.1.57
349
+
350
+ - Changed behavior when leaving state in which var is defined by alg flow,
351
+ and entering state with no alg flow.
352
+
353
+ - Resets are now allowed in algebraic state, even if the reset value will be
354
+ overridden by the next alg evaluation.
355
+
356
+ redshift 1.1.56
357
+
358
+ - Misc fixes, cleanup, and tests.
359
+
360
+ redshift 1.1.55
361
+
362
+ - Re-fixed bug with order in which guards are checked.
363
+
364
+ - Defaults and setup clauses can take a hash of var=>value, as can variable
365
+ declarations.
366
+
367
+ redshift 1.1.54
368
+
369
+ - Fixed bug with transition S=>S and strict guards.
370
+
371
+ - Fixed bug with order in which guards are checked.
372
+
373
+ redshift 1.1.53
374
+
375
+ - Fixed bug with both link.contvar and link.constant in one gaurd expr.
376
+
377
+ - Fixed bug: strict link to nonstrict variable was treated as strict.
378
+
379
+ - Optimization: strict guards checked less often. (See bench/half-strict.rb.)
380
+
381
+ redshift 1.1.52
382
+
383
+ - Added bench/half-strict.rb.
384
+
385
+ redshift 1.1.51
386
+
387
+ - Added NonStrictLink test to test_strict_continuity.rb.
388
+
389
+ redshift 1.1.50
390
+
391
+ - Optimization: algebraic flows that are current at end of step_continuous
392
+ don't need to be evaled until d_tick > 1.
393
+
394
+ redshift 1.1.49
395
+
396
+ - Minor optimization: strict alg. vars in a non-strict alg expr or guard are
397
+ evaled only once per discrete step.
398
+
399
+ redshift 1.1.48
400
+
401
+ - Added new benchmark framework, and the discrete and constinuous benchmarks.
402
+
403
+ redshift 1.1.47
404
+
405
+ - Optimization for 'inert' components.
406
+
407
+ - More useful interface for Component.state.
408
+
409
+ redshift 1.1.46
410
+
411
+ - Resets for links.
412
+
413
+ redshift 1.1.45
414
+
415
+ - Resets for constants.
416
+
417
+ redshift 1.1.44
418
+
419
+ - Fixed reporting of strictness violations.
420
+
421
+ - Added test/test_strict_reset_error.rb.
422
+
423
+ - Outgoing transitions are cached for each state.
424
+
425
+ redshift 1.1.43
426
+
427
+ - Optimization for strictly continuous var readers.
428
+
429
+ redshift 1.1.42
430
+
431
+ - Added runtime check for strictness violation due to transition to state
432
+ with inconsistent algebraic equation.
433
+
434
+ redshift 1.1.41
435
+
436
+ - Added infrastructure for checking strictness and strictness violations
437
+ at run time.
438
+
439
+ redshift 1.1.40
440
+
441
+ - Strictness violations of writers can be rescued, and the value remains set.
442
+
443
+ - Renaned ContinuousAssignmentError to StrictnessError
444
+
445
+ - World#age removed; use #evolve instead.
446
+
447
+ - Improved test_strict_continuity.rb.
448
+
449
+ redshift 1.1.39
450
+
451
+ - Added World.defaults.
452
+
453
+ redshift 1.1.38
454
+
455
+ - Added strict links.