Skip to content
Snippets Groups Projects
Commit dc73df88 authored by patham9's avatar patham9
Browse files

added button to hide/show stamp completely

parent 023cb223
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -36,6 +36,10 @@ import nars.language.Term;
* limit.
*/
public class Stamp implements Cloneable {
/**
* show stamp or not
*/
public static boolean showStamp=true;
/**
* show derivation chain or not
*/
......@@ -335,6 +339,8 @@ public class Stamp implements Cloneable {
*/
@Override
public String toString() {
if(!showStamp)
return "";
StringBuilder buffer = new StringBuilder(" " + Symbols.STAMP_OPENER + creationTime);
buffer.append(" ").append(Symbols.STAMP_STARTER).append(" ");
for (int i = 0; i < baseLength; i++) {
......
......@@ -325,14 +325,14 @@ public class Memory {
}
stamp.addToChain(currentTask.getContent());
}
if (!revised) {
if (!revised) { //its a inference rule, we have to do the derivation chain check to hamper cycles
for (Term chain1 : chain) {
if (task.getContent() == chain1) {
recorder.append("!!! Cyclic Reasoning detected: " + task + "\n");
return;
}
}
} else //its revision, of course its cyclic, dont apply new stamp policy
} else //its revision, of course its cyclic, apply evidental base policy
{
for (int i = 0; i < stamp.baseLength(); i++) {
for (int j = 0; j < stamp.baseLength(); j++) {
......
......@@ -158,6 +158,7 @@ public class MainWindow extends NarsFrame implements ActionListener, OutputChann
addJMenuItem(m, "Inference Log");
addJMenuItem(m, "Input Window");
addJMenuItem(m, "Show/Hide Derivations");
addJMenuItem(m, "Show/Hide Stamp");
m.addActionListener(this);
menuBar.add(m);
......@@ -336,6 +337,8 @@ public class MainWindow extends NarsFrame implements ActionListener, OutputChann
silentW.setVisible(true);
} else if (label.equals("Show/Hide Derivations")) {
Stamp.showDerivationChain=!Stamp.showDerivationChain;
} else if (label.equals("Show/Hide Stamp")) {
Stamp.showStamp=!Stamp.showStamp;
} else if (label.equals("Related Information")) {
// MessageDialog web =
new MessageDialog(this, NARS.WEBSITE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment