source: tags/arb_5.5/TREEGEN/sim.c

Last change on this file was 1612, checked in by westram, 21 years ago

translated to english

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1#ifndef __RNS_H
2#include "rns.h"
3#endif
4#ifndef __SIMCFG_H
5#include "simcfg.h"
6#endif
7#ifndef __TIME_H
8#include <time.h>
9#endif
10#ifndef __STDLIB_H
11#include <stdlib.h>
12#endif
13#ifndef __BASE_H
14#include "base.h"
15#endif
16
17/* --------------------------------------------------------------------------- */
18/*      int main(int argc, str argv[]) */
19/* ------------------------------------------------------ 14.05.95 11.14 ----- */
20int main(int argc, str argv[])
21{
22    RNS origin;
23
24    if (argc!=4) error("Usage: arb_treegen <cfg> <tree> <seq>\n"
25                       "An evolution simulator - (C) 1995 by Ralf Westram\n"
26                       "\n"
27                       "Environment specification is read from <cfg> (will be generated if missing)\n"
28                       "\n"
29                       "<tree> file were the simulated phylogeny is saved to (as tree)\n"
30                       "<seq>  file were the simulated species are saved to (as sequences)\n"
31                       );
32
33    srand((unsigned)time(NULL));
34    initBaseLookups();
35
36    readSimCfg(argv[1]);
37    origin = createOriginRNS();
38
39    topo = fopen(argv[2], "w"); if (!topo) { perror(argv[2]); exit(1); }
40    seq = fopen(argv[3], "w"); if (!seq) { perror(argv[3]); exit(1); }
41
42    splitRNS(-1, origin, 0.0, timeSteps, 0);
43    dumpDepths();
44
45    fclose(seq);
46    fclose(topo);
47
48    free(origin);
49    return 0;
50}
51
52
53
Note: See TracBrowser for help on using the repository browser.