# include "ppSim.h"

int main(int argc, char *argv[])
{
    psLibInit(NULL);
    if (!pmModelClassInit ()) abort();

    pmConfig *config = pmConfigRead(&argc, argv, NULL); // Configuration
    if (!config) {
        psErrorStackPrint(stderr, "Unable to read configurations.");
        exit(PS_EXIT_CONFIG_ERROR);
    }

    ppSimArguments(argc, argv, config);

    if (!ppSimCreate(config)) {
        psErrorStackPrint(stderr, "Unable to create output file.");
        psFree(config);
        exit(PS_EXIT_CONFIG_ERROR);
    }

    if (!ppSimLoop(config)) {
        psErrorStackPrint(stderr, "Unable to generate data.");
        psFree(config);
        exit(PS_EXIT_SYS_ERROR);
    }

    psFree(config);
    pmModelClassCleanup();
    pmConfigDone();
    pmConceptsDone();
    psLibFinalize();

    return PS_EXIT_SUCCESS;
}
