Beispiel #1
0
int main(int argc, char *argv[])
{
    GenericAgentConfig config = CheckOpts(argc, argv);

    GenericInitialize("knowledge", config);
    ThisAgentInit();

    KeepKnowControlPromises();

    if (strlen(STORY) > 0)
    {
#ifdef HAVE_CONSTELLATION
       if (strncmp(STORY, "SHA=", 4) == 0)
       {
          char buffer[CF_BUFSIZE];
          
                Constellation_HostStory(STORY, buffer, CF_BUFSIZE);
                printf("%s\n", buffer);
       }
       else
       {
          strcpy(TOPIC_CMD, STORY);
          
          printf("Let's start with stories about cause-effect:\n\n");
          CfGenerateStories(TOPIC_CMD, cfi_cause);
          printf("Now looking for stories about connections between things:\n\n");
          CfGenerateStories(TOPIC_CMD, cfi_connect);
          printf("Anything about structure:\n\n");
                CfGenerateStories(TOPIC_CMD, cfi_part);
       }
#endif
            exit(0);
            
    }
    
    if (GENERATE_XML)
    {
        GenerateXml();
    }
    else if (strlen(TOPIC_CMD) == 0)
    {
        int complete;
        double percent;

        KeepPromiseBundles();
        WriteKMDB();
        GenerateManual();
        ShowWords();
        ShowSingletons();

        complete = (double) CF_TOPICS *(CF_TOPICS - 1);

        percent = 100.0 * (double) CF_EDGES / (double) complete;
        CfOut(cf_inform, "", " -> Association density yields %d/%d = %.4lf%%\n", CF_EDGES, complete, percent);
        percent = 100.0 * (double) CF_OCCUR / (double) CF_TOPICS;
        CfOut(cf_inform, "", " -> Hit probability (efficiency) yields %d/%d = %.4lf%%\n", CF_OCCUR, CF_TOPICS, percent);
    }

    return 0;
}
Beispiel #2
0
int main(int argc, char *argv[])
{
    GenericAgentConfig config = CheckOpts(argc, argv);

    ReportContext *report_context = OpenReports("gendoc");
    GenericInitialize("gendoc", config, report_context);

    if (GENERATE_XML)
    {
        GenerateXml();
    }
    else
    {
        GenerateManual();
    }

    ReportContextDestroy(report_context);
    return 0;
}
Beispiel #3
0
int main(int argc, char *argv[])
{
    GenericAgentConfig *config = CheckOpts(argc, argv);

    ReportContext *report_context = OpenReports(config->agent_type);
    GenericAgentDiscoverContext(config, report_context);

    if (GENERATE_XML)
    {
        GenerateXml();
    }
    else
    {
        GenerateManual();
    }

    ReportContextDestroy(report_context);
    GenericAgentConfigDestroy(config);
    return 0;
}