
-------------------------------------------------------
 Most common errors/warnings  when you use DYNACLIPS.
-------------------------------------------------------



-------------------------------------------------------
**  " ...msgsnd failed!!!: No more processes"
-------------------------------------------------------

This error means that Queue is in Operating system is full.
Control is not fast enough to handle incoming requiests from
agents.
   Possible reasons ... 
     -- One of the agents continuously sends add/or delete
        request  to control. When you design your system you should
        not add something to blackboard if it is already there 
        by other agents. Also you should not try to delete something
        if it is not in blackboard.
        Following is one of the  possible solutions. 
       
            If   not (hi there) 
                  then ADD_BB_STR (ALL FACT (hi there) )

            if   (hi there)
                  then DEL_BB_STR (ALL FACT (hi there) )

     -- Your computer system is slow. 



-------------------------------------------------------
** What is the best way for one-to-one communications. 
-------------------------------------------------------

You can send a assert command to other agents. In
that case you do not have to waste space in the blackboard..
   
for instance, agent2 calls:

ADD_BB_STR "agent1 COMMAND ( assert (xxxx) )"

(xxxx) will be a fact in the agent1 and it will 
not stay in the blackboard. Therefore you do not
need to remove it from BB. Also you do not need to
specify destination in the fact..




-------------------------------------------------------
** Following is one of the most common mistakes.
-------------------------------------------------------

  (xxxx) is a fact in the blackboard..

 An agent has following rule
     
    (defrule CCC
        ?msg <- (xxxx)
        =>
        (retract ?msg)
         )

You should NOT retract a fact which is a member of blackboard..
If you need to retract it you should remove it from BB using
DEL_BB_STR. 
after CCC is  rule excuted,  (xxxx)  will be in fact list again.
You can not remove it with retract.

     




-------------------------------------------------------
*** I'd like to use this <agent id> in the clips code  
-------------------------------------------------------
(knowledge source name is <agentID>) is an initial fact
in all agents. 









-------------------------------------------------------
** Following is one of the most common mistake.
-------------------------------------------------------
In order to exit from system properly, 
you should have following rule in all agents.

(defrule exit-all
(all exit)
=>
(EXIT_CLIPS))





-------------------------------------------------------
** Following is one of the most common mistake.
-------------------------------------------------------
 DYNACLIPS (DYNAmic CLIPS Utilities)  Version 2.0 (TEST VERSION)
 Copyright 1994 by Yilmaz Cengeloglu

 control for DYNACLIPS .....msg: msgget failed!!!
: Invalid argument
msg: msgget failed!!!
: Invalid argument
msg: msgget failed!!!
: Invalid argument
 ERROR! create: Invalid argument




---------------------------------------------------
 Control: Control is ready
---------------------------------------------------
 

IPC is not set in your computer. When you enter ipcs command
from unix shell, you should see following
-------------------
[cambridge]3: ipcs
IPC status from cambridge as of Fri Mar 18 08:12:31 1994
T     ID     KEY        MODE       OWNER    GROUP
Message Queues:
Shared Memory:
Semaphores:
[cambridge]4:
----------------------
If you do not see this message, you need to ask your system
administrator to set it. You need to be root to set it.








-------------------------------------------------------s
  ** Following is one of the most common mistake.
-------------------------------------------------------s

Control: WARNING, Some KS did not READ,STATUS= 6 

Control broadcasts the blackboard and wait acknowledge
signal from each agent. If there is any agent  that does not 
send acknowledge signal. (agent exited improperly)
Control waits certain time  and gives a this warning.








-------------------------------------------------------s
  ** Following is one of the most common mistake.
-------------------------------------------------------s
main.c:  If you integrate dynaclips into a clips system where you have
already added extensions, you must put the DEFINE_DYNACLIPS_FUNCTIONS
statement AFTER the extensions you have already.

I have no idea WHY ?

> ----------------- FAILS ------------------------
> VOID UserFunctions()
> {
> DEFINE_DYNACLIPS_FUNCTIONS();
>
> extern int dec();
> DefineFunction ("dec", 'i', PTIF dec, "dec");
> }
> 

> ----------------- COMPILES ------------------------
> VOID UserFunctions()
> {
> extern int dec();
> DefineFunction ("dec", 'i', PTIF dec, "dec");
> 
> DEFINE_DYNACLIPS_FUNCTIONS();
> }







-------------------
 
> From causse@vision.auc.dk Wed Apr 27 10:34:30 1994
> From: causse@vision.auc.dk (Olivier Causse)
> Subject: WARNING, Some KS did not READ Blackboard
> To: cengelog@sunny.dab.ge.com (Yilmaz Cengeloglu)
> Date: Wed, 27 Apr 1994 16:32:25 +0200 (MET DST)
> X-Mailer: ELM [version 2.4 PL21]
> Content-Type> : > text>
> Content-Length: 404
>
> Hi Yilmaz,
>
> I haven't mail you for a while but I'm still using DYNACLIPS (3.0) and
> I have some problems. Would it be possible for the control message :
>
>       Control: WARNING, Some KS did not READ Blackboard
>
> to know which KS did not read the blackboard, because
> sometimes it's hard to guess.
 
 
This is not not easy to fix immediately. Each agent sends a acknowledge
signal to control when it reads blackboard succesfully. They do not send
their ID.
 
Control only knows number of active agent in the system and does not
keep names of the agents in the system.  If number of incoming acknowledge
signal less than number of agent, it will give a warning.
 
I have not passed Agent ID  because it was bringing additional job
to control and it would slow down whole system. Control has to keep
list of active agent in the system and has to compare with incoming
signals each time blackboard broadcasted.
 
I am not really sure that this is really necessary to implement.
 
 
Control: WARNING, Some KS did not READ Blackboard means following :
        1- an agent is in indefinite loop can not read blackboard
        2- an agent exits from system without caling EXIT_CLIPS command.
        3- an agent is waiting input from user.
        4- an agent is to slow to respond to control.

>
> By the way, are you still working on Dynaclips. Have you any
> plans for a version 4.0 ?
>
 
I am not working on Version 4.0 at this time.  I might work depending
on number of problems/suggestions reported. As of today I have only
one suggestions.

> Best regards,
>
>       Olivier.
>








--------------------------------------
 Some comments on speed.
--------------------------------------
 
There are still complains about speed of DYNACLIPS. I have done
my best to get speed up on DYNACLIPS. If you have any suggestions
please let me know.
 
 
Followings are reason why DYNACLIPS would be slow.
--------------
** Some of you use several agents (10 or more)  in their project.
Each agent is a CLIPS shell and they all run simultaneously.
You need a faster CLIPS and/or faster workstation.
I have add an  a algorithm that
if any agents does not have any rule to fire, it will sleep.
Agent will wake up if there would be any change in the blackboard.
There is nothing else  I can do in this case. If you have any
comment let me know.
 
--------------
** You have some agent that continously sending request to control.
 
For instance,
   (yyyy)  and (mmmm) are  facts in the blackbord.
 
Agent 1 has following rule
 
  if (mmmm) insert (yyyy) to blackboard.
 
  This rule will slow down whole system because agents 1
will continously send that request to control which is not
necessary to handle at all.
 
One of the solution would be.
 
 if (mmmm) and  ( not (yyyy) ) insert (yyyy) to blackboard.
 

--------------
**   You have too many one to one continous communication. You should
try to use blackboard for exchanging common information. For
one to one communication you may want to use other approaches
such as IPC message queues, etc.
 
 
--------------
** Some of you are suggested that Each agents should run on
separate CPU ( Distributed DYNACLIPS). Of course this the best
solution for speed up  but not everyone has access to  distributed
hardware.  Number of distributed DYNACLIPS  user is not good enough for me
to make work on it.
 




