## 04/06/2012 - 3:23PM
source('h:/watersmart/lib.R')

## define some variables 
nstate <- 2		# number of 'states' 
## for 2 states, the threshhold defaults to the median.  I will keep this threshhold for this example.
trace.len <- 50  # length of traces
nsim <- 1200  # number of traces
rdata.file <- paste('leesferry-hg-',nstate,'-state.RData',sep='')  # file name for .RData file (saves output)
rdata.file.cc <- paste('leesferry-hg-',nstate,'-state-cc.RData',sep='')  # file name for .RData file (saves output)

## filepath will default to the current working directory.  
## therefore, it is noteworth to know whether user has file-
## editing privelages in the current working directory
## I am now setting the current working directory:
#setwd('h:/watersmart/scriptdata/hgmc/')
## The directory could also be supplied as filepath='h:/watersmart/'

## read the paleo data (tree rings!)
paleo <- 'h:/watersmart/scriptdata/hgmc/lf_paleo.txt'

## read the observed flow data (Lee's Ferry)
x <- 'h:/watersmart/scriptdata/hgmc/lf_yr_vector.txt'


v_cc_hg(xpath=x,paleopath=paleo,m=nstate,sim.len=trace.len,nsims=nsim,thresh=NULL,filepath='c:/users/verdina/desktop/testing/hg/',output.rdata=rdata.file,mean.change=NULL,returnpath='c:/users/verdina/desktop/testing/hg/hgSuccess.txt')

## the file 'output/SimFlow-HG-2-state.txt' will be output, as mean.change is NULL

v_cc_hg(xpath=x,paleopath=paleo,m=nstate,sim.len=trace.len,nsims=nsim,thresh=NULL,filepath='c:/users/verdina/desktop/testing/hg/',output.rdata=rdata.file.cc,mean.change=-0.1,returnpath='c:/users/verdina/desktop/testing/hg/hgSuccess_cc.txt')

## the file 'output/SimFlow-HG-cc-2-state.txt' will be output, as mean.change is 10%