CyAn contains command line tools for post processing and analyzing Cyclus simulation databases (http://fuelcycle.org). It is still experimental and not all features have been validated/verified to be correct.
Binary builds of CyAn are provided for Windows, Linux, and Mac platforms (both 32 and 64 bit) here: https://github.com/rwcarlsen/cyan/releases. These binaries have no external dependencies and can just be executed directly.
To build and install from source, you need the Go toolchain. You can get it from http://golang.org/doc/install or you can use your favorite package manager:
# debian-based distros
apt-get install golang
# archlinux
pacman -S go
# mac OSX with macports
port install go
You should make a directory to use as your GOPATH and set the GOPATH
environment variable to it. The Go tool will install packages into this
directory. For convenience, you should also add $GOPATH/bin
to your PATH so
that binaries from fetched packages are directly accessible on the command
line. When you are ready, run:
go get github.com/rwcarlsen/cyan/cmd/cyan
There primary command line tool is cyan
. The commands has various flags and
subcommands that can be viewed with the -h
flag:
cyan -h
Usage: cyan -db <cyclus-db> [flags...] <command> [flags...] [args...]
Computes metrics for cyclus simulation data in a sqlite database.
-cpuprofile="": write cpu profile to file
-custom="": path to custom sql query spec file
-db="": cyclus sqlite database to query
-h=false: print this help message
-query=false: show query SQL for a subcommand instead of executing it
-simid="": simulation id in hex (empty string defaults to first sim id in database
Sub-commands:
post: Just post process the database
infile: Show the simulation's input file
sims: List all simulations in the database
agents: List all agents in the simulation
protos: List all prototypes in the simulation
commods: Show commodities with respective transaction counts and quantities
table: Show the contents of a specific table
trans: Time series of transactions over time (by quantity)
power: Time series of power produced
deployed: Time series of a prototype's total active deployments
built: Time series of a new builds of a prototype
inv: Time series of agents' inventory
flow: Time series of material transacted between agents
flowgraph: Generate a graphviz dotfile graph of resource flows between agents
energy: Thermal energy (J) generated by the simulation between 2 timesteps
created: Material created by one or more agents between specific timesteps
Some quick examples:
# just post process the db (this is done automatically by other commands too)
cyan -db cyclus.sqlite post
# output a png graph of the flow of all material between agents t=2 to t=7
cyan -db cyclus.sqlite flowgraph -t1=2 -t2=7 > flow.dot
dot -Tpng -o flow.png flow.dot
# output a time series of active deployments for all AP1000 facilities
cyan -db cyclus.sqlite deployed AP1000
# plot a active deployments for all AP1000 facilities using gnuplot
cyan -db cyclus.sqlite deployed -p AP1000
To cross-compile for all major architectures/OS's supported by Go, you can use
xgo
(https://github.com/karalabe/xgo) - for example:
xgo github.com/rwcarlsen/cyan/cmd/cycpost
And you will get 32 and 64 bit binaries for Mac, Windows, Linux, and Arm. Note that newer versions of cyan require github.com/rwcarlsen/xgo's cpp-support branch - which hasn't been merged into upstream xgo yet.