0
votes

Why the command

clips.eval("(set-strategy random)")

don't work? I have differents rule that can be activated but they are activeted always in the same order.

1

1 Answers

0
votes

It is not clear from your description which of the following two scenarios is occurring:

  1. CLIPSJNI launched once. Multiple runs produce same order.
  2. CLIPSJNI launched multiple times. Single run produces same order as last launch.

For #1, you have not provided enough information to replicate the issue. For #2, this is the relevant information from section 5.37 of the Basic Programming Guide:

The random strategy is useful for testing. Because this strategy randomly orders activations having the same salience, it is useful in detecting whether the execution order of rules with the same salience effects the program behavior. Before running a program with the random strategy, first seed the random number generator using the seed function. The same seed value can be subsequently be used if it is necessary to replicate the results of the program run.

So for #2, make this call from your code:

clips.eval("(seed (integer (time)))");