clipsruby 0.0.43 → 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 +377 -0
  4. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fc073e3a6ed11b566b2aff954ff17fcb2874fa1cf83f8b4fbeba5b893d204bc
4
- data.tar.gz: f9c000d65fae9a2140f43bf234e8b3360937f461df35e5b2e659dac942048063
3
+ metadata.gz: 2c9cd2640f2fe1fe923a67eedc51756a103b1d7efe16ba242cb511f4457c48b1
4
+ data.tar.gz: 66468126873d355fbba614bbc0ce86dd33e6064b1c32a6d54012a0a7007b3b29
5
5
  SHA512:
6
- metadata.gz: 522fe0e9ca9ad792684bac67b24708897f68840586c180e5e8712fa9920561b1f9316e968d22bb7cf5371f1467705b2b6e739a649cff0d7fa22f76433164e60e
7
- data.tar.gz: 630373e7297ac2945d7a560d4db06262b482b526591e7a7d685a6305ffbd6e5f2864ad58b49eea0e8481f7806515dba5d4cd29388685b7d2429cf79a18307097
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.
@@ -3027,6 +3027,53 @@ static VALUE clips_environment_defmodule_static_find_instance(int argc, VALUE *a
3027
3027
  }
3028
3028
  }
3029
3029
 
3030
+ static VALUE clips_environment_defmodule_refresh_agenda(VALUE self)
3031
+ {
3032
+ Defmodule *module;
3033
+
3034
+ TypedData_Get_Struct(self, Defmodule, &Defmodule_type, module);
3035
+
3036
+ RefreshAgenda(module);
3037
+
3038
+ return Qnil;
3039
+ }
3040
+
3041
+ static VALUE clips_environment_defmodule_static_refresh_agenda(VALUE self, VALUE rbDefmodule)
3042
+ {
3043
+ return clips_environment_defmodule_refresh_agenda(rbDefmodule);
3044
+ }
3045
+
3046
+ static VALUE clips_environment_defmodule_reorder_agenda(VALUE self)
3047
+ {
3048
+ Defmodule *module;
3049
+
3050
+ TypedData_Get_Struct(self, Defmodule, &Defmodule_type, module);
3051
+
3052
+ ReorderAgenda(module);
3053
+
3054
+ return Qnil;
3055
+ }
3056
+
3057
+ static VALUE clips_environment_defmodule_static_reorder_agenda(VALUE self, VALUE rbDefmodule)
3058
+ {
3059
+ return clips_environment_defmodule_reorder_agenda(rbDefmodule);
3060
+ }
3061
+
3062
+ static VALUE clips_environment_defmodule_delete_all_activations(VALUE self)
3063
+ {
3064
+ Defmodule *module;
3065
+
3066
+ TypedData_Get_Struct(self, Defmodule, &Defmodule_type, module);
3067
+
3068
+ DeleteAllActivations(module);
3069
+
3070
+ return Qnil;
3071
+ }
3072
+
3073
+ static VALUE clips_environment_defmodule_static_delete_all_activations(VALUE self, VALUE rbDefmodule)
3074
+ {
3075
+ return clips_environment_defmodule_delete_all_activations(rbDefmodule);
3076
+ }
3030
3077
 
3031
3078
  static VALUE clips_environment_find_deftemplate(VALUE self, VALUE deftemplate_name)
3032
3079
  {
@@ -4776,6 +4823,238 @@ static VALUE clips_environment_static_get_watch_state(VALUE self, VALUE rbEnviro
4776
4823
  return clips_environment_get_watch_state(rbEnvironment, item);
4777
4824
  }
4778
4825
 
4826
+ static VALUE clips_environment_refresh_all_agendas(VALUE self)
4827
+ {
4828
+ Environment *env;
4829
+
4830
+ TypedData_Get_Struct(self, Environment, &Environment_type, env);
4831
+
4832
+ RefreshAllAgendas(env);
4833
+
4834
+ return Qnil;
4835
+ }
4836
+
4837
+ static VALUE clips_environment_static_refresh_all_agendas(VALUE self, VALUE rbEnvironment)
4838
+ {
4839
+ return clips_environment_refresh_all_agendas(rbEnvironment);
4840
+ }
4841
+
4842
+ static VALUE clips_environment_reorder_all_agendas(VALUE self)
4843
+ {
4844
+ Environment *env;
4845
+
4846
+ TypedData_Get_Struct(self, Environment, &Environment_type, env);
4847
+
4848
+ ReorderAllAgendas(env);
4849
+
4850
+ return Qnil;
4851
+ }
4852
+
4853
+ static VALUE clips_environment_static_reorder_all_agendas(VALUE self, VALUE rbEnvironment)
4854
+ {
4855
+ return clips_environment_reorder_all_agendas(rbEnvironment);
4856
+ }
4857
+
4858
+ static VALUE clips_environment_get_agenda_changed(VALUE self)
4859
+ {
4860
+ Environment *environment;
4861
+
4862
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
4863
+
4864
+ return GetAgendaChanged(environment) ? Qtrue : Qfalse;
4865
+ }
4866
+
4867
+ static VALUE clips_environment_static_get_agenda_changed(VALUE self, VALUE rbEnvironment)
4868
+ {
4869
+ return clips_environment_get_agenda_changed(rbEnvironment);
4870
+ }
4871
+
4872
+ static VALUE clips_environment_set_agenda_changed(VALUE self, VALUE changed)
4873
+ {
4874
+ Environment *environment;
4875
+
4876
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
4877
+
4878
+ SetAgendaChanged(environment, changed == Qtrue);
4879
+
4880
+ return Qnil;
4881
+ }
4882
+
4883
+ static VALUE clips_environment_static_set_agenda_changed(VALUE self, VALUE rbEnvironment, VALUE changed)
4884
+ {
4885
+ return clips_environment_set_agenda_changed(rbEnvironment, changed);
4886
+ }
4887
+
4888
+ // copied from agenda.c, not exposed in agenda.h
4889
+ /*****************************************************************/
4890
+ /* SalienceEvaluationName: Given the integer value corresponding */
4891
+ /* to a specified salience evaluation behavior, returns a */
4892
+ /* character string of the behavior's name. */
4893
+ /*****************************************************************/
4894
+ static const char *SalienceEvaluationName(
4895
+ SalienceEvaluationType strategy)
4896
+ {
4897
+ const char *sname;
4898
+
4899
+ switch (strategy)
4900
+ {
4901
+ case WHEN_DEFINED:
4902
+ sname = "when-defined";
4903
+ break;
4904
+ case WHEN_ACTIVATED:
4905
+ sname = "when-activated";
4906
+ break;
4907
+ case EVERY_CYCLE:
4908
+ sname = "every-cycle";
4909
+ break;
4910
+ default:
4911
+ sname = "unknown";
4912
+ break;
4913
+ }
4914
+
4915
+ return sname;
4916
+ }
4917
+
4918
+ static VALUE clips_environment_get_salience_evaluation(VALUE self)
4919
+ {
4920
+ Environment *environment;
4921
+
4922
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
4923
+
4924
+ return ID2SYM(rb_intern(SalienceEvaluationName(GetSalienceEvaluation(environment))));
4925
+ }
4926
+
4927
+ static VALUE clips_environment_static_get_salience_evaluation(VALUE self, VALUE rbEnvironment)
4928
+ {
4929
+ return clips_environment_get_salience_evaluation(rbEnvironment);
4930
+ }
4931
+
4932
+ static VALUE clips_environment_set_salience_evaluation(VALUE self, VALUE changed)
4933
+ {
4934
+ Environment *environment;
4935
+ const char *argument, *oldValue;
4936
+
4937
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
4938
+
4939
+ argument = rb_id2name(SYM2ID(changed));
4940
+ oldValue = SalienceEvaluationName(GetSalienceEvaluation(environment));
4941
+
4942
+ if (strcmp(argument,"when-defined") == 0)
4943
+ { SetSalienceEvaluation(environment,WHEN_DEFINED); }
4944
+ else if (strcmp(argument,"when-activated") == 0)
4945
+ { SetSalienceEvaluation(environment,WHEN_ACTIVATED); }
4946
+ else if (strcmp(argument,"every-cycle") == 0)
4947
+ { SetSalienceEvaluation(environment,EVERY_CYCLE); }
4948
+ else
4949
+ {
4950
+ rb_warn("set_salience_evaluation: symbol must be when-defined, when-activated, or every-cycle");
4951
+ return Qfalse;
4952
+ }
4953
+
4954
+ return ID2SYM(rb_intern(oldValue));
4955
+ }
4956
+
4957
+ static VALUE clips_environment_static_set_salience_evaluation(VALUE self, VALUE rbEnvironment, VALUE changed)
4958
+ {
4959
+ return clips_environment_set_salience_evaluation(rbEnvironment, changed);
4960
+ }
4961
+
4962
+ // copied from crstrtgy.c
4963
+ // not exposed in crstrtgy.h
4964
+ /**********************************************************/
4965
+ /* GetStrategyName: Given the integer value corresponding */
4966
+ /* to a specified strategy, return a character string */
4967
+ /* of the strategy's name. */
4968
+ /**********************************************************/
4969
+ static const char *GetStrategyName(
4970
+ StrategyType strategy)
4971
+ {
4972
+ const char *sname;
4973
+
4974
+ switch (strategy)
4975
+ {
4976
+ case DEPTH_STRATEGY:
4977
+ sname = "depth";
4978
+ break;
4979
+ case BREADTH_STRATEGY:
4980
+ sname = "breadth";
4981
+ break;
4982
+ case LEX_STRATEGY:
4983
+ sname = "lex";
4984
+ break;
4985
+ case MEA_STRATEGY:
4986
+ sname = "mea";
4987
+ break;
4988
+ case COMPLEXITY_STRATEGY:
4989
+ sname = "complexity";
4990
+ break;
4991
+ case SIMPLICITY_STRATEGY:
4992
+ sname = "simplicity";
4993
+ break;
4994
+ case RANDOM_STRATEGY:
4995
+ sname = "random";
4996
+ break;
4997
+ default:
4998
+ sname = "unknown";
4999
+ break;
5000
+ }
5001
+
5002
+ return(sname);
5003
+ }
5004
+
5005
+ static VALUE clips_environment_get_strategy(VALUE self)
5006
+ {
5007
+ Environment *environment;
5008
+
5009
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
5010
+
5011
+ return ID2SYM(rb_intern(GetStrategyName(GetStrategy(environment))));
5012
+ }
5013
+
5014
+ static VALUE clips_environment_static_get_strategy(VALUE self, VALUE rbEnvironment)
5015
+ {
5016
+ return clips_environment_get_strategy(rbEnvironment);
5017
+ }
5018
+
5019
+ static VALUE clips_environment_set_strategy(VALUE self, VALUE changed)
5020
+ {
5021
+ Environment *environment;
5022
+ const char *argument, *oldValue;
5023
+
5024
+ TypedData_Get_Struct(self, Environment, &Environment_type, environment);
5025
+
5026
+ argument = rb_id2name(SYM2ID(changed));
5027
+ oldValue = GetStrategyName(GetStrategy(environment));
5028
+
5029
+ if (strcmp(argument,"depth") == 0)
5030
+ { SetStrategy(environment,DEPTH_STRATEGY); }
5031
+ else if (strcmp(argument,"breadth") == 0)
5032
+ { SetStrategy(environment,BREADTH_STRATEGY); }
5033
+ else if (strcmp(argument,"lex") == 0)
5034
+ { SetStrategy(environment,LEX_STRATEGY); }
5035
+ else if (strcmp(argument,"mea") == 0)
5036
+ { SetStrategy(environment,MEA_STRATEGY); }
5037
+ else if (strcmp(argument,"complexity") == 0)
5038
+ { SetStrategy(environment,COMPLEXITY_STRATEGY); }
5039
+ else if (strcmp(argument,"simplicity") == 0)
5040
+ { SetStrategy(environment,SIMPLICITY_STRATEGY); }
5041
+ else if (strcmp(argument,"random") == 0)
5042
+ { SetStrategy(environment,RANDOM_STRATEGY); }
5043
+ else
5044
+ {
5045
+ rb_warn("set_strategy: symbol must be depth, breadth, lex, mea, complexity, simplicity, or random");
5046
+ return Qfalse;
5047
+ }
5048
+
5049
+ return ID2SYM(rb_intern(oldValue));
5050
+ }
5051
+
5052
+ static VALUE clips_environment_static_set_strategy(VALUE self, VALUE rbEnvironment, VALUE changed)
5053
+ {
5054
+ return clips_environment_set_strategy(rbEnvironment, changed);
5055
+ }
5056
+
5057
+
4779
5058
  static VALUE clips_environment_activation_defrule_name(VALUE self)
4780
5059
  {
4781
5060
  Activation *activation;
@@ -4790,6 +5069,74 @@ static VALUE clips_environment_activation_static_defrule_name(VALUE self, VALUE
4790
5069
  return clips_environment_activation_defrule_name(rbActivation);
4791
5070
  }
4792
5071
 
5072
+ static VALUE clips_environment_activation_get_salience(VALUE self)
5073
+ {
5074
+ Activation *activation;
5075
+
5076
+ TypedData_Get_Struct(self, Activation, &Activation_type, activation);
5077
+
5078
+ return LONG2NUM(ActivationGetSalience(activation));
5079
+ }
5080
+
5081
+ static VALUE clips_environment_activation_static_get_salience(VALUE self, VALUE rbActivation)
5082
+ {
5083
+ return clips_environment_activation_get_salience(rbActivation);
5084
+ }
5085
+
5086
+ static VALUE clips_environment_activation_set_salience(VALUE self, VALUE salience)
5087
+ {
5088
+ Activation *activation;
5089
+
5090
+ TypedData_Get_Struct(self, Activation, &Activation_type, activation);
5091
+
5092
+ return LONG2NUM(ActivationSetSalience(activation, NUM2LONG(salience)));
5093
+ }
5094
+
5095
+ static VALUE clips_environment_activation_static_set_salience(VALUE self, VALUE rbActivation, VALUE salience)
5096
+ {
5097
+ return clips_environment_activation_set_salience(rbActivation, salience);
5098
+ }
5099
+
5100
+ static VALUE clips_environment_activation_pp_form(VALUE self)
5101
+ {
5102
+ Environment *env;
5103
+ Activation *activation;
5104
+ StringBuilder *sb;
5105
+ VALUE toReturn;
5106
+
5107
+ VALUE rbEnvironment = rb_iv_get(self, "@environment");
5108
+ TypedData_Get_Struct(rbEnvironment, Environment, &Environment_type, env);
5109
+ sb = CreateStringBuilder(env, 0);
5110
+
5111
+ TypedData_Get_Struct(self, Activation, &Activation_type, activation);
5112
+
5113
+ ActivationPPForm(activation, sb);
5114
+ toReturn = rb_str_new2(sb->contents);
5115
+ SBDispose(sb);
5116
+
5117
+ return toReturn;
5118
+ }
5119
+
5120
+ static VALUE clips_environment_activation_static_pp_form(VALUE self, VALUE rbActivation)
5121
+ {
5122
+ return clips_environment_activation_pp_form(rbActivation);
5123
+ }
5124
+
5125
+ static VALUE clips_environment_activation_delete(VALUE self)
5126
+ {
5127
+ Activation *activation;
5128
+
5129
+ TypedData_Get_Struct(self, Activation, &Activation_type, activation);
5130
+
5131
+ DeleteActivation(activation);
5132
+
5133
+ return Qnil;
5134
+ }
5135
+
5136
+ static VALUE clips_environment_activation_static_delete(VALUE self, VALUE rbActivation)
5137
+ {
5138
+ return clips_environment_activation_delete(rbActivation);
5139
+ }
4793
5140
 
4794
5141
  void Init_clipsruby(void)
4795
5142
  {
@@ -4944,6 +5291,22 @@ void Init_clipsruby(void)
4944
5291
  rb_define_method(rbEnvironment, "get_watch_state", clips_environment_get_watch_state, 1);
4945
5292
  rb_define_singleton_method(rbEnvironment, "make_instance", clips_environment_static_make_instance, -1);
4946
5293
  rb_define_method(rbEnvironment, "make_instance", clips_environment_make_instance, -1);
5294
+ rb_define_singleton_method(rbEnvironment, "refresh_all_agendas", clips_environment_static_refresh_all_agendas, 1);
5295
+ rb_define_method(rbEnvironment, "refresh_all_agendas", clips_environment_refresh_all_agendas, 0);
5296
+ rb_define_singleton_method(rbEnvironment, "reorder_all_agendas", clips_environment_static_reorder_all_agendas, 1);
5297
+ rb_define_method(rbEnvironment, "reorder_all_agendas", clips_environment_reorder_all_agendas, 0);
5298
+ rb_define_singleton_method(rbEnvironment, "get_agenda_changed", clips_environment_static_get_agenda_changed, 1);
5299
+ rb_define_method(rbEnvironment, "get_agenda_changed", clips_environment_get_agenda_changed, 0);
5300
+ rb_define_singleton_method(rbEnvironment, "set_agenda_changed", clips_environment_static_set_agenda_changed, 2);
5301
+ rb_define_method(rbEnvironment, "set_agenda_changed", clips_environment_set_agenda_changed, 1);
5302
+ rb_define_singleton_method(rbEnvironment, "get_salience_evaluation", clips_environment_static_get_salience_evaluation, 1);
5303
+ rb_define_method(rbEnvironment, "get_salience_evaluation", clips_environment_get_salience_evaluation, 0);
5304
+ rb_define_singleton_method(rbEnvironment, "set_salience_evaluation", clips_environment_static_set_salience_evaluation, 2);
5305
+ rb_define_method(rbEnvironment, "set_salience_evaluation", clips_environment_set_salience_evaluation, 1);
5306
+ rb_define_singleton_method(rbEnvironment, "get_strategy", clips_environment_static_get_strategy, 1);
5307
+ rb_define_method(rbEnvironment, "get_strategy", clips_environment_get_strategy, 0);
5308
+ rb_define_singleton_method(rbEnvironment, "set_strategy", clips_environment_static_set_strategy, 2);
5309
+ rb_define_method(rbEnvironment, "set_strategy", clips_environment_set_strategy, 1);
4947
5310
 
4948
5311
  VALUE rbDeffacts = rb_define_class_under(rbEnvironment, "Deffacts", rb_cObject);
4949
5312
  rb_define_alloc_func(rbDeffacts, deffacts_alloc);
@@ -5007,6 +5370,12 @@ void Init_clipsruby(void)
5007
5370
  rb_define_method(rbDefmodule, "get_defrule_list", clips_environment_defmodule_get_defrule_list, 0);
5008
5371
  rb_define_singleton_method(rbDefmodule, "find_instance", clips_environment_defmodule_static_find_instance, -1);
5009
5372
  rb_define_method(rbDefmodule, "find_instance", clips_environment_defmodule_find_instance, -1);
5373
+ rb_define_singleton_method(rbDefmodule, "refresh_agenda", clips_environment_defmodule_static_refresh_agenda, 1);
5374
+ rb_define_method(rbDefmodule, "refresh_agenda", clips_environment_defmodule_refresh_agenda, 0);
5375
+ rb_define_singleton_method(rbDefmodule, "reorder_agenda", clips_environment_defmodule_static_reorder_agenda, 1);
5376
+ rb_define_method(rbDefmodule, "reorder_agenda", clips_environment_defmodule_reorder_agenda, 0);
5377
+ rb_define_singleton_method(rbDefmodule, "delete_all_activations", clips_environment_defmodule_static_delete_all_activations, 1);
5378
+ rb_define_method(rbDefmodule, "delete_all_activations", clips_environment_defmodule_delete_all_activations, 0);
5010
5379
 
5011
5380
  VALUE rbFact = rb_define_class_under(rbEnvironment, "Fact", rb_cObject);
5012
5381
  rb_define_alloc_func(rbFact, fact_alloc);
@@ -5092,4 +5461,12 @@ void Init_clipsruby(void)
5092
5461
  rb_define_alloc_func(rbActivation, activation_alloc);
5093
5462
  rb_define_singleton_method(rbActivation, "defrule_name", clips_environment_activation_static_defrule_name, 1);
5094
5463
  rb_define_method(rbActivation, "defrule_name", clips_environment_activation_defrule_name, 0);
5464
+ rb_define_singleton_method(rbActivation, "get_salience", clips_environment_activation_static_get_salience, 1);
5465
+ rb_define_method(rbActivation, "get_salience", clips_environment_activation_get_salience, 0);
5466
+ rb_define_singleton_method(rbActivation, "set_salience", clips_environment_activation_static_set_salience, 2);
5467
+ rb_define_method(rbActivation, "set_salience", clips_environment_activation_set_salience, 1);
5468
+ rb_define_singleton_method(rbActivation, "pp_form", clips_environment_activation_static_pp_form, 1);
5469
+ rb_define_method(rbActivation, "pp_form", clips_environment_activation_pp_form, 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);
5095
5472
  }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipsruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.43
4
+ version: 0.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Johnston
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Calling the CLIPS programming language from within Ruby
14
13
  email: mrryanjohnston@gmail.com
@@ -369,7 +368,6 @@ licenses:
369
368
  metadata:
370
369
  documentation_uri: https://github.com/mrryanjohnston/clipsruby/blob/main/README.md
371
370
  source_code_uri: https://github.com/mrryanjohnston/clipsruby
372
- post_install_message:
373
371
  rdoc_options: []
374
372
  require_paths:
375
373
  - lib
@@ -385,8 +383,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
383
  - !ruby/object:Gem::Version
386
384
  version: '0'
387
385
  requirements: []
388
- rubygems_version: 3.5.16
389
- signing_key:
386
+ rubygems_version: 3.6.9
390
387
  specification_version: 4
391
388
  summary: Calling CLIPS from within Ruby
392
389
  test_files: []