clipsruby 0.0.44 → 0.0.45

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +176 -1
  3. data/ext/clipsruby/clipsruby.c +5 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83db571b1b54cd6848878cfd5422841e150e51f11b5616640460bce6bac024ef
4
- data.tar.gz: 5a25ab26198c8d7b1e92fa8d6c903f01455ac36c7eeaa307255002c45733e55c
3
+ metadata.gz: 2c9cd2640f2fe1fe923a67eedc51756a103b1d7efe16ba242cb511f4457c48b1
4
+ data.tar.gz: 66468126873d355fbba614bbc0ce86dd33e6064b1c32a6d54012a0a7007b3b29
5
5
  SHA512:
6
- metadata.gz: 3ce8105ae4ebab196499a520513f56f1b433c712d14e0d3f87f0febe3f20b2dd156bc21c0c69ece6fd9990e5775aa92bd274a231b58bbdf66892ca0975cb46d4
7
- data.tar.gz: b375fdfb92af2c1aa02add709b983c1b81cc1376393017026526ca8ac17a8bb6f1aba0776a264bd9eebbceab1d4cc885649a3c8c333eb8b93ec91253c100e8f4
6
+ metadata.gz: efefcb6fe9b23f5d3c9711066d7113ae8413f581ba14160cef069a5843fca5c2c52de7677f364d78ff87c2b706b7aeaea65ce92194babc9d9f411fe9de4b2989
7
+ data.tar.gz: 7fc6d37228814375d88e21f09737383ba69c450f5a989cc8f8c2a1dbb22d792e6970627cc0eda249d38b0250afb2a7648347edc9ea2b184195e1280643278fd1
data/README.md CHANGED
@@ -536,6 +536,110 @@ CLIPS::Environment.unwatch(:facts)
536
536
  env.unwatch(:statistics)
537
537
  ```
538
538
 
539
+ #### `CLIPS::Environment#refresh_all_agendas` / `CLIPS::Environment.refresh_all_agendas`
540
+
541
+ Refresh agendas in all `Defmodule`s in the CLIPS `Environment`.
542
+
543
+ ```ruby
544
+ CLIPS::Environment.refresh_all_agendas(env)
545
+ env.refresh_all_agendas
546
+ ```
547
+
548
+ #### `CLIPS::Environment#reorder_all_agendas` / `CLIPS::Environment.reorder_all_agendas`
549
+
550
+ Reorder agendas in all `Defmodule`s in the CLIPS `Environment`.
551
+
552
+ ```ruby
553
+ CLIPS::Environment.reorder_all_agendas(env)
554
+ env.reorder_all_agendas
555
+ ```
556
+
557
+ #### `CLIPS::Environment#get_agenda_changed` / `CLIPS::Environment.get_agenda_changed`
558
+
559
+ Returns whether or not the agenda was changed in the `Environment`.
560
+
561
+ ```ruby
562
+ CLIPS::Environment.get_agenda_changed(env)
563
+ env.get_agenda_changed
564
+ ```
565
+
566
+ #### `CLIPS::Environment#set_agenda_changed` / `CLIPS::Environment.set_agenda_changed`
567
+
568
+ Sets whether or not the agenda was changed in the `Environment`.
569
+
570
+ ```ruby
571
+ CLIPS::Environment.set_agenda_changed(env, false)
572
+ env.set_agenda_changed true
573
+ ```
574
+
575
+ #### `CLIPS::Environment#get_salience_evaluation` / `CLIPS::Environment.get_salience_evaluation`
576
+
577
+ Returns the salience evaluation current set in the `Environment`.
578
+ Possible return values are:
579
+
580
+ - `:"when-defined"`
581
+ - `:"when-activated"`
582
+ - `:"every-cycle"`
583
+ - `:unknown`
584
+
585
+ ```ruby
586
+ CLIPS::Environment.get_salience_evaluation(env)
587
+ env.get_salience_evaluation
588
+ ```
589
+
590
+ #### `CLIPS::Environment#set_salience_evaluation` / `CLIPS::Environment.set_salience_evaluation`
591
+
592
+ Sets the salience evaluation in the `Environment`.
593
+ Possible arguments are:
594
+
595
+ - `:"when-defined"`
596
+ - `:"when-activated"`
597
+ - `:"every-cycle"`
598
+ - `:unknown`
599
+
600
+ ```ruby
601
+ CLIPS::Environment.set_salience_evaluation(env, :"when-defined")
602
+ env.set_salience_evaluation :"every-cycle"
603
+ ```
604
+
605
+ #### `CLIPS::Environment#get_strategy` / `CLIPS::Environment.get_strategy`
606
+
607
+ Returns the strategy current set in the `Environment`.
608
+ Possible return values are:
609
+
610
+ - `:depth`
611
+ - `:breadth`
612
+ - `:lex`
613
+ - `:mea`
614
+ - `:complexity`
615
+ - `:simplicity`
616
+ - `:random`
617
+ - `:unknown`
618
+
619
+ ```ruby
620
+ CLIPS::Environment.get_strategy(env)
621
+ env.get_strategy
622
+ ```
623
+
624
+ #### `CLIPS::Environment#set_strategy` / `CLIPS::Environment.set_strategy`
625
+
626
+ Sets the strategy in the `Environment`.
627
+ Possible arguments are:
628
+
629
+ - `:depth`
630
+ - `:breadth`
631
+ - `:lex`
632
+ - `:mea`
633
+ - `:complexity`
634
+ - `:simplicity`
635
+ - `:random`
636
+ - `:unknown`
637
+
638
+ ```ruby
639
+ CLIPS::Environment.set_strategy(env, :lex)
640
+ env.set_strategy :mea
641
+ ```
642
+
539
643
  ### Fact Methods
540
644
 
541
645
  #### `CLIPS::Environment::Fact.pp_form` / `CLIPS::Environment::Fact#pp_form`
@@ -951,6 +1055,41 @@ CLIPS::Environment::Defmodule.get_defrule_list(defmodule)
951
1055
  defmodule.get_defrule_list
952
1056
  ```
953
1057
 
1058
+ #### `CLIPS::Environment::Defmodule.refresh_agenda` / `CLIPS::Environment::Defmodule#refresh_agenda`
1059
+
1060
+ Refreshes the agenda in a given Defmodule.
1061
+ If you used `CLIPS::Environment::Activation.set_salience` /
1062
+ `CLIPS::Environment::Activation#set_salience` to set the salience
1063
+ of an activation, using `refresh_agenda` will set it back to its
1064
+ original salience.
1065
+
1066
+ ```ruby
1067
+ CLIPS::Environment::Defmodule.refresh_agenda(defmodule)
1068
+ defmodule.refresh_agenda
1069
+ ```
1070
+
1071
+ #### `CLIPS::Environment::Defmodule.reorder_agenda` / `CLIPS::Environment::Defmodule#reorder_agenda`
1072
+
1073
+ Refreshes the agenda in a given Defmodule.
1074
+ If you used `CLIPS::Environment::Activation.set_salience` /
1075
+ `CLIPS::Environment::Activation#set_salience` to set the salience
1076
+ of an activation, using `reorder_agenda` will re-order the agenda
1077
+ according to the new salience of activations on the agenda.
1078
+
1079
+ ```ruby
1080
+ CLIPS::Environment::Defmodule.reorder_agenda(defmodule)
1081
+ defmodule.reorder_agenda
1082
+ ```
1083
+
1084
+ #### `CLIPS::Environment::Defmodule.delete_all_activations` / `CLIPS::Environment::Defmodule#delete_all_activations`
1085
+
1086
+ Deletes all activations in the agenda in a given Defmodule.
1087
+
1088
+ ```ruby
1089
+ CLIPS::Environment::Defmodule.delete_all_activations(defmodule)
1090
+ defmodule.delete_all_activations
1091
+ ```
1092
+
954
1093
  ### Deftemplate Methods
955
1094
 
956
1095
  #### `CLIPS::Environment::Deftemplate.name` / `CLIPS::Environment::Deftemplate#name`
@@ -1165,7 +1304,16 @@ deffacts.pp_form
1165
1304
 
1166
1305
  ### Activation Methods
1167
1306
 
1168
- #### `CLIPS::Environment::Activation.defule_name` / `CLIPS::Environment::Activation#defule_name`
1307
+ #### `CLIPS::Environment::Activation.delete` / `CLIPS::Environment::Activation#delete`
1308
+
1309
+ Deletes an `Activation` from the agenda.
1310
+
1311
+ ```ruby
1312
+ CLIPS::Environment::Activation.delete
1313
+ activation.delete
1314
+ ```
1315
+
1316
+ #### `CLIPS::Environment::Activation.defrule_name` / `CLIPS::Environment::Activation#defrule_name`
1169
1317
 
1170
1318
  Returns the name of a defrule that triggered this activation.
1171
1319
 
@@ -1174,6 +1322,33 @@ CLIPS::Environment::Activation.defrule_name
1174
1322
  activation.defrule_name
1175
1323
  ```
1176
1324
 
1325
+ #### `CLIPS::Environment::Activation.get_salience` / `CLIPS::Environment::Activation#get_salience`
1326
+
1327
+ Returns the salience of this activation.
1328
+
1329
+ ```ruby
1330
+ CLIPS::Environment::Activation.get_salience(activation)
1331
+ activation.get_salience
1332
+ ```
1333
+
1334
+ #### `CLIPS::Environment::Activation.set_salience` / `CLIPS::Environment::Activation#set_salience`
1335
+
1336
+ Sets the salience of this activation.
1337
+
1338
+ ```ruby
1339
+ CLIPS::Environment::Activation.set_salience(activation, 11)
1340
+ activation.set_salience 123
1341
+ ```
1342
+
1343
+ #### `CLIPS::Environment::Activation.pp_form` / `CLIPS::Environment::Activation#pp_form`
1344
+
1345
+ Returns a pretty printed string representation of the Activation
1346
+
1347
+ ```ruby
1348
+ CLIPS::Environment::Activation.pp_form(activation)
1349
+ activation.pp_form
1350
+ ```
1351
+
1177
1352
  ## Running the tests
1178
1353
 
1179
1354
  Simply do `rake compile` and then `rake test` in order to run the tests.
@@ -5122,7 +5122,7 @@ static VALUE clips_environment_activation_static_pp_form(VALUE self, VALUE rbAct
5122
5122
  return clips_environment_activation_pp_form(rbActivation);
5123
5123
  }
5124
5124
 
5125
- static VALUE clips_environment_activation_delete_activation(VALUE self)
5125
+ static VALUE clips_environment_activation_delete(VALUE self)
5126
5126
  {
5127
5127
  Activation *activation;
5128
5128
 
@@ -5133,9 +5133,9 @@ static VALUE clips_environment_activation_delete_activation(VALUE self)
5133
5133
  return Qnil;
5134
5134
  }
5135
5135
 
5136
- static VALUE clips_environment_activation_static_delete_activation(VALUE self, VALUE rbActivation)
5136
+ static VALUE clips_environment_activation_static_delete(VALUE self, VALUE rbActivation)
5137
5137
  {
5138
- return clips_environment_activation_delete_activation(rbActivation);
5138
+ return clips_environment_activation_delete(rbActivation);
5139
5139
  }
5140
5140
 
5141
5141
  void Init_clipsruby(void)
@@ -5467,6 +5467,6 @@ void Init_clipsruby(void)
5467
5467
  rb_define_method(rbActivation, "set_salience", clips_environment_activation_set_salience, 1);
5468
5468
  rb_define_singleton_method(rbActivation, "pp_form", clips_environment_activation_static_pp_form, 1);
5469
5469
  rb_define_method(rbActivation, "pp_form", clips_environment_activation_pp_form, 0);
5470
- rb_define_singleton_method(rbActivation, "delete_activation", clips_environment_activation_static_delete_activation, 1);
5471
- rb_define_method(rbActivation, "delete_activation", clips_environment_activation_delete_activation, 0);
5470
+ rb_define_singleton_method(rbActivation, "delete", clips_environment_activation_static_delete, 1);
5471
+ rb_define_method(rbActivation, "delete", clips_environment_activation_delete, 0);
5472
5472
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipsruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.44
4
+ version: 0.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Johnston