diff --git a/LICENSE.rst b/LICENSE.rst new file mode 100644 index 0000000000..23f8ff1bbc --- /dev/null +++ b/LICENSE.rst @@ -0,0 +1,35 @@ + +******* +LICENSE +******* +:: + + Copyright (c) 2010-2012, University of Wisconsin Computational Nuclear Engineering Research Group + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + - Neither the name of the University of Wisconsin Computational + Nuclear Engineering Research Group nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst index 1f98ae5d23..5296f8ebca 100644 --- a/README.rst +++ b/README.rst @@ -1,127 +1,148 @@ -_______________________________________________________________________ +################################################### Cycamore : The CYClus Additional MOdules REpository -_______________________________________________________________________ - -**Last Updated: 6.10.2012** +################################################### Additional modules for the Cyclus nuclear fuel cycle simulator from the University of Wisconsin - Madison are intended to be support innovative fuel cycle simulations with the Cyclus fuel cycle simulator. -To see user and developer documentation for this code, please visit the `Cycamore Homepage`_. - - ------------------------------------------------------------------------ -LISCENSE ------------------------------------------------------------------------ - -:: +To see user and developer documentation for this code, please visit +the `Cycamore Homepage`_. - Copyright (c) 2010-2012, University of Wisconsin Computational Nuclear Engineering Research Group - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the University of Wisconsin Computational - Nuclear Engineering Research Group nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------- +******************************** Building and Installing Cycamore ------------------------------------------------------------------- +******************************** -The `Cyclus Homepage`_ and `Cycamore Homepage`_ have much more detailed guides and information. -This Readme is intended to be a quick reference for building and installing the -cyamore module libraries for the first time. - -The Cycamore code requires the following software and libraries. +In order to facilitate future compatibility with multiple platforms, +Cycamore is built using `CMake`_. A full list of the Cycamore package +dependencies is show below: ==================== ================== Package Minimum Version ==================== ================== -`Cyclus` 0.1 `CMake` 2.8 `boost` 1.34.1 -`libxml2` 2 -`sqlite3` 3.7.10 +`libxml2` 2 +`Cyclopts` 0.1 +`Cyclus` 0.1 ==================== ================== -~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Building Cycamore -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In order to facilitate future compatibility with multiple platforms, Cycamore is -built using `Cmake `_. This relies on CMake version -2.8 or higher and the CMakeLists.txt file in `src/`. It is -recommended that you use CMake to build the Cycamore libraries in a directory -external to the source code. Now, to use the cycamore modules within a cyclus -simulation, you must already have cyclus installed . Once that is done, build the -cycamore module libraries by the following steps:: - - .../cycamore/$ mkdir build - .../cycamore/$ cd build - .../cycamore/build$ cmake ../src -DCYCLUS_ROOT_DIR= - -You should see output like this:: - - ... - ... - >> -- Configuring done - >> -- Generating done - >> -- Build files have been written to: .../cycamore/build - /cycamore/build$ make cycamore - >> Scanning dependencies of target cycamore - ... - ... - >> [100%] Building CXX object CMakeFiles/cycamore.dir/SourceFac.cpp.o - >> Linking CXX executable cycamore - >> [100%] Built target cycamore - -~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Installing Cycamore -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +As with all software, the build/install can be broken into two steps: -To allow cyclus to find the cycamore module libraries, you must install them within -the cyclus installation directory. To do so, execute :: + #. building and installing the dependencies + #. building and installing Cycamore - .../cycamore/build$ make - .../cycamore/build$ make install +Installing Dependencies +======================= -If the cyclus installation directory is in a system location, you will need to -execute `sudo make install` instead of `make install`. -The `Cyclus Homepage`_ has much more detailed guides and information. If -you intend to develop for *Cyclus*, please visit it to learn more. +This guide assumes that the user has root access (to issue sudo +commands) and access to a package manager or has some other suitable +method of automatically installing established libraries. This process +was tested using a fresh install of Ubuntu 12.10. +Cyclus +------ -.. _`Cyclus Homepage`: http://cyclus.github.com -.. _`Cycamore Homepage`: http://cycamore.github.com +The Cyclus Library is the simulation-engine core of the more general +Cyclus package, of which Cycamore is a part. Detailed build/install +instructions are provided in the `Cyclus readme`_. We assume that the +user has successfully built and installed Cyclus (as well as Cyclopts +and CMake) for the following discussion. + +All Others +---------- + +All other dependencies are common libraries available through package +managers. We provide an example using `apt-get`_. All required +commands will take the form of: +.. code-block:: bash + sudo apt-get install package --------------------------------------------------------------------------- +Where you will replace "package" with the correct package name. The +list of required package names are: + + #. libboost-all-dev + #. libxml++2.6-dev + +So, for example, in order to install libxml++ on your system, you will +type: + +.. code-block:: bash + + sudo apt-get install libxml++2.6-dev + +Let us take a moment to note the Boost library dependency. As it +currently stands, we in fact depend on a small subset of the Boost +libraries: + + #. libboost-filesystem-dev + #. libboost-system-dev + +However, it is possible (likely) that additional Boost libraries will +be used because they are an industry standard. Accordingly, we suggest +simply installing libboost-all-dev to limit any headaches due to +possible dependency additions in the future. + +Installing Cycamore +=================== + +Assuming you have the dependencies installed correctly, it's pretty +straightforward to install Cycamore. We make the following assumptions +in this guide: + + #. there is some master directory in which you're placing all + Cyclus-related files called .../cyclus + #. you have a directory named .../cyclus/install in which you plan + to install all Cyclus-related files + #. you have acquired the Cycamore source code from the + `Cycamore repo`_ + #. you have placed the Cycamore repository in .../cyclus/cycamore + #. you have a directory named .../cyclus/cycamore/build in which + you plan to encapsulate all build-related files (they get in the + way otherwise) + #. you have installed Cyclopts using the CMAKE_INSTALL_PREFIX + variable set to ../cyclus/install (see the `Cyclopts readme`_) + #. you have installed Cyclus using the CMAKE_INSTALL_PREFIX + variable set to ../cyclus/install (see the `Cyclus readme`_) + +Under these assumptions **and** if you used a package manager to +install coin-Cbc (i.e. it's installed in a standard location), the +Cyclus building and installation process will look like: + +.. code-block:: bash + + .../cyclus/cycamore$ cd build + .../cyclus/cycamore/build$ cmake ../src -DCMAKE_INSTALL_PREFIX=../../install -DCYCLOPTS_ROOT_DIR=../../install -DCYCLUS_ROOT_DIR=../../install + .../cyclus/cycamore/build$ make && make install + +If you have installed coin-Cbc from source or otherwise have it +installed in a non-standard location, you should make use of the CMake +COIN_ROOT_DIR variable. The otherwise identical process would look +like: + +.. code-block:: bash + + .../cyclus/cycamore$ cd build + .../cyclus/cycamore/build$ cmake ../src -DCMAKE_INSTALL_PREFIX=../../install -DCYCLOPTS_ROOT_DIR=../../install -DCYCLUS_ROOT_DIR=../../install -DCOIN_ROOT_DIR=/the/path/to/coin/install + .../cyclus/cycamore/build$ make && make install + +.. _`CMake`: http://www.cmake.org +.. _`apt-get`: http://linux.die.net/man/8/apt-get +.. _`Cyclus Homepage`: http://cyclus.github.com +.. _`Cyclus repo`: https://github.com/cyclus/cyclus +.. _`Cyclus readme`: http://github.com/cyclus/cyclus +.. _`Cycamore Homepage`: http://cycamore.github.com +.. _`Cycamore repo`: https://github.com/cyclus/cycamore +.. _`Cycamore readme`: https://github.com/cyclus/cycamore +.. _`Cyclopts Homepage`: http://cyclopts.github.com +.. _`Cyclopts repo`: https://github.com/cyclus/cyclopts +.. _`Cyclopts readme`: https://github.com/cyclus/cyclopts + +********************** The Developer Workflow --------------------------------------------------------------------------- +********************** *Note that "upstream" repository refers to the primary `cyclus/cycamore` repository.* @@ -139,9 +160,8 @@ Code from the "develop" branch generally must pass even more rigorous checks before being integrated into the "master" branch. Hotfixes would be a possible exception to this. -~~~~~~~~~~~~~~~~~~~ Workflow Notes -~~~~~~~~~~~~~~~~~~~ +============== * Use a branching workflow similar to the one described at http://progit.org/book/ch3-4.html. @@ -237,10 +257,8 @@ Workflow Notes git checkout develop git merge --no-ff remote_name/branch_name -m "A message"" - -~~~~~~~~~~~~~~~~~~~ Cautions -~~~~~~~~~~~~~~~~~~~ +======== * **NEVER** merge the "master" branch into the "develop" branch. Changes should only flow *to* the "master" branch *from* the @@ -261,14 +279,11 @@ Cautions git pull [remote] [from-branch] - -~~~~~~~~~~~~~~~~~~~ An Example -~~~~~~~~~~~~~~~~~~~ - +========== Introduction -============ +------------ As this type of workflow can be complicated to converts from SVN and very complicated for brand new programmers, an example is provided. @@ -281,13 +296,13 @@ three branches: "Master", "Develop", and "Work". Acquiring Cycamore and Workflow -============================= +------------------------------- We begin with a fork of the main ("upstream") Cycamore repository. After initially forking the repo, we will have two branches in our fork: "Master" and "Develop". Acquiring a Fork of the Cycamore Repository ------------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A fork is *your* copy of Cycamore. Github offers an excelent `tutorial `_ on how to set one up. The rest of this @@ -309,7 +324,7 @@ fork's branches up to date (i.e., "push" your changes before you leave), only yo copies of your branches may be different when you next sit down at the other location. Workflow: The Beginning ------------------------ +^^^^^^^^^^^^^^^^^^^^^^^ Now, for the workflow! This is by no means the only way to perform this type of workflow, but I assume that you wish to handle conflicts as often as possible (so as to keep their total @@ -338,8 +353,7 @@ We then follow the same process to update the work branch, except: #. we want to incorporate any changes which may have been introduced in the develop branch update. Workflow: The End ------------------ - +^^^^^^^^^^^^^^^^^ As time passes, you make some changes to files, and you commit those changes (to your *local work branch*). Eventually (hopefully) you come to a stopping point where you have finished your project diff --git a/input/enrichment/1_src_enr_rxtr_sink.xml b/input/enrichment/1_src_enr_rxtr_sink.xml index a39f415d34..8a421c18e6 100644 --- a/input/enrichment/1_src_enr_rxtr_sink.xml +++ b/input/enrichment/1_src_enr_rxtr_sink.xml @@ -91,7 +91,7 @@ used_fuel_recipe 1 - 2 + 2 1 power diff --git a/src/CMake/FindCOIN.cmake b/src/CMake/FindCOIN.cmake deleted file mode 100644 index ba424617e4..0000000000 --- a/src/CMake/FindCOIN.cmake +++ /dev/null @@ -1,138 +0,0 @@ -# modeled after FindCOIN.cmake in the lemon project - -IF(NOT DEFINED COIN_ROOT_DIR) - SET(COIN_ROOT_DIR "$ENV{COIN_ROOT_DIR}") - MESSAGE("\tCOIN Root Dir: ${COIN_INCLUDE_DIR}") -ENDIF(NOT DEFINED COIN_ROOT_DIR) - -MESSAGE(STATUS "COIN_ROOT_DIR hint is : ${COIN_ROOT_DIR}") - -# if installed in a non-standard location, -# the include directory must be added to the PATH variable -FIND_PATH(COIN_INCLUDE_DIR coin/CbcModel.hpp - HINTS "${COIN_INCLUDE_DIR}" - HINTS "${COIN_ROOT_DIR}/include" - HINTS /usr/ - HINTS /usr/include/ - HINTS /usr/local/ - HINTS /usr/local/include/ - HINTS /usr/coin/ - HINTS /usr/coin-Cbc/ - HINTS /usr/local/coin/ - HINTS /usr/local/coin-Cbc/ -) -#MESSAGE("\tCOIN Include Dir: ${COIN_INCLUDE_DIR}") - -set(COIN_INCLUDE_DIR ${COIN_INCLUDE_DIR}/coin) -#MESSAGE("\tCOIN Include Dir: ${COIN_INCLUDE_DIR}") - -FIND_LIBRARY(COIN_CBC_LIBRARY - NAMES Cbc libCbc - HINTS "${COIN_INCLUDE_DIR}/../../lib/" - HINTS "${COIN_ROOT_DIR}/lib" -) -MESSAGE("\tCOIN CBC: ${COIN_CBC_LIBRARY}") - -FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY - NAMES CbcSolver libCbcSolver - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN CBC solver: ${COIN_CBC_SOLVER_LIBRARY}") - -FIND_LIBRARY(COIN_CGL_LIBRARY - NAMES Cgl libCgl - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN CGL: ${COIN_CGL_LIBRARY}") - -FIND_LIBRARY(COIN_CLP_LIBRARY - NAMES Clp libClp - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN CLP: ${COIN_CLP_LIBRARY}") - -FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY - NAMES CoinUtils libCoinUtils - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN UTILS: ${COIN_COIN_UTILS_LIBRARY}") - -FIND_LIBRARY(COIN_OSI_LIBRARY - NAMES Osi libOsi - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN OSI: ${COIN_OSI_LIBRARY}") - -# FIXME Uncomment for COIN 2.7+, leave commented for earlier versions -A. -#FIND_LIBRARY(COIN_OSI_CBC_LIBRARY -# NAMES OsiCbc libOsiCbc -# HINTS ${COIN_INCLUDE_DIR}/../../lib/ -# HINTS "${COIN_ROOT_DIR}/lib" -#) -#MESSAGE("\tCOIN OSI CBC: ${COIN_OSI_CBC_LIBRARY}") - -FIND_LIBRARY(COIN_OSI_CLP_LIBRARY - NAMES OsiClp libOsiClp - HINTS ${COIN_INCLUDE_DIR}/../../lib/ - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN OSI CLP: ${COIN_OSI_CLP_LIBRARY}") - -FIND_LIBRARY(COIN_ZLIB_LIBRARY - NAMES z libz - HINTS ${COIN_ROOT_DIR}/lib - HINTS "${COIN_ROOT_DIR}/lib" -) -#MESSAGE("\tCOIN ZLIP: ${COIN_ZLIB_LIBRARY}") - -FIND_LIBRARY(COIN_BZ2_LIBRARY - NAMES bz2 libz2 - HINTS ${COIN_ROOT_DIR}/lib - HINTS "${COIN_ROOT_DIR}/lib" -) -# #MESSAGE("\tCOIN BZ2: ${COIN_BZ2_LIBRARY}") - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG - COIN_INCLUDE_DIR - COIN_CBC_LIBRARY - COIN_CBC_SOLVER_LIBRARY - COIN_CGL_LIBRARY - COIN_CLP_LIBRARY - COIN_COIN_UTILS_LIBRARY - COIN_OSI_LIBRARY -# FIXME Uncomment for COIN 2.7+, leave commented for earlier versions -A. -# COIN_OSI_CBC_LIBRARY - COIN_OSI_CLP_LIBRARY - COIN_ZLIB_LIBRARY - COIN_BZ2_LIBRARY -) - -IF(COIN_FOUND) - SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR}) - SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY}") - IF(COIN_ZLIB_LIBRARY) - SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}") - ENDIF(COIN_ZLIB_LIBRARY) - IF(COIN_BZ2_LIBRARY) - SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}") - ENDIF(COIN_BZ2_LIBRARY) - - # FIXME Use first line for COIN 2.7+, use the second for earlier versions -A. - #SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}") - SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_CLP_LIBRARIES}") - - SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES}) -ENDIF(COIN_FOUND) - -# let us know if we found it -IF(COIN_INCLUDE_DIRS) - MESSAGE("\tFound COIN Include Dirs: ${COIN_INCLUDE_DIRS}") -ELSE(COIN_INCLUDE_DIRS) - MESSAGE("\tCOIN Include Dirs NOT FOUND") -ENDIF(COIN_INCLUDE_DIRS) diff --git a/src/CMake/FindCYCLOPTS.cmake b/src/CMake/FindCYCLOPTS.cmake index 165639d19f..73495b8db3 100644 --- a/src/CMake/FindCYCLOPTS.cmake +++ b/src/CMake/FindCYCLOPTS.cmake @@ -1,13 +1,23 @@ +IF(NOT DEFINED CYCLOPTS_ROOT_DIR) + SET(CYCLOPTS_ROOT_DIR "$ENV{CYCLOPTS_ROOT_DIR}") +ENDIF(NOT DEFINED CYCLOPTS_ROOT_DIR) + +MESSAGE(STATUS "CYCLOPTS_ROOT_DIR hint is : ${CYCLOPTS_ROOT_DIR}") + # if installed in a non-standard location, # the include directory must be added to the PATH variable FIND_PATH(CYCLOPTS_INCLUDE_DIR cyclopts/Variable.h + HINTS "${CYCLOPTS_INCLUDE_DIR}" + HINTS "${CYCLOPTS_ROOT_DIR}" + HINTS "${CYCLOPTS_ROOT_DIR}/include" HINTS /usr/ HINTS /usr/include/ HINTS /usr/local/ HINTS /usr/local/include/ HINTS /usr/cyclopts/ HINTS /usr/local/cyclopts/ + HINTS ${CYCLOPTS_HINT}/ ) set(CYCLOPTS_INCLUDE_DIR ${CYCLOPTS_INCLUDE_DIR}/cyclopts) diff --git a/src/CMake/Findcycluscore.cmake b/src/CMake/Findcycluscore.cmake index f46dd83b6b..930511cab5 100644 --- a/src/CMake/Findcycluscore.cmake +++ b/src/CMake/Findcycluscore.cmake @@ -2,25 +2,35 @@ # CYCLUS_CORE_INCLUDE_DIR - the Cyclus include directory # CYCLUS_CORE_LIBRARIES - The libraries needed to use the Cyclus Core Library -IF(NOT DEFINED CYCLUS_ROOT_DIR) - SET(CYCLUS_ROOT_DIR "$ENV{CYCLUS_ROOT_DIR}") -ENDIF(NOT DEFINED CYCLUS_ROOT_DIR) +# Check if we have an environment variable to cyclus root +IF(DEFINED ENV{CYCLUS_ROOT_DIR}) + IF(NOT DEFINED CYCLUS_ROOT_DIR) + SET(CYCLUS_ROOT_DIR "$ENV{CYCLUS_ROOT_DIR}") + ELSE(NOT DEFINED CYCLUS_ROOT_DIR) + # Yell if both exist + MESSAGE(STATUS "\tTwo CYCLUS_ROOT_DIRs have been found:") + MESSAGE(STATUS "\t\tThe defined cmake variable CYCLUS_ROOT_DIR: ${CYCLUS_ROOT_DIR}") + MESSAGE(STATUS "\t\tThe environment variable CYCLUS_ROOT_DIR: $ENV{CYCLUS_ROOT_DIR}") + ENDIF(NOT DEFINED CYCLUS_ROOT_DIR) +ENDIF(DEFINED ENV{CYCLUS_ROOT_DIR}) -# Look for the header files +# Let the user know if we're using a hint +IF(DEFINED CYCLUS_ROOT_DIR) + MESSAGE(STATUS "CYCLUS_ROOT_DIR hint is : ${CYCLUS_ROOT_DIR}") +ELSE(DEFINED CYCLUS_ROOT_DIR) + MESSAGE(STATUS "No hint is used for CYCLUS_ROOT_DIR") +ENDIF(DEFINED CYCLUS_ROOT_DIR) + +# Set the include dir, this will be the future basis for other +# defined dirs FIND_PATH(CYCLUS_CORE_INCLUDE_DIR suffix.h HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" /usr/local/cyclus /opt/local/cyclus PATH_SUFFIXES cyclus/include include) -MESSAGE(STATUS "CYCLUS_ROOT_DIR hint is : ${CYCLUS_ROOT_DIR}") - # Add the root dir to the hints -IF(CYCLUS_ROOT_DIR MATCHES "/") -ELSE(CYCLUS_ROOT_DIR MATCHES "/") - SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/..") - MESSAGE(STATUS "CYCLUS_ROOT_DIR hint has been set to : ${CYCLUS_ROOT_DIR}") -ENDIF(CYCLUS_ROOT_DIR MATCHES "/") - +SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/..") +MESSAGE(STATUS "CYCLUS_ROOT_DIR hint has been set to : ${CYCLUS_ROOT_DIR}") # Look for the header files FIND_PATH(CYCLUS_CORE_SHARE_DIR cyclus.rng.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 43b5f20d1d..0129ae202f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,33 +56,27 @@ FIND_PACKAGE( cycluscore REQUIRED ) SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${CYCLUS_CORE_INCLUDE_DIR}) SET(LIBS ${LIBS} ${CYCLUS_CORE_LIBRARIES}) +# find cyclopts and link to it +FIND_PACKAGE( CYCLOPTS REQUIRED ) +MESSAGE(STATUS "Cyclopts-related build info:") +SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${CYCLOPTS_INCLUDE_DIR}) +set(LIBS ${LIBS} ${CYCLOPTS_LIBRARY}) +MESSAGE("\tCyclopts include: ${CYCLOPTS_INCLUDE_DIR}") +MESSAGE("\tCyclopts lib: ${CYCLOPTS_LIBRARY}") + # Find LibXML++ and dependencies FIND_PACKAGE( LibXML++ REQUIRED ) SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${LibXML++_INCLUDE_DIR} ${Glibmm_INCLUDE_DIRS} ${LibXML++Config_INCLUDE_DIR}) SET(LIBS ${LIBS} ${LibXML++_LIBRARIES}) MESSAGE(${LIBS}) -# Include the boost header files and the program_options library -# KDHFLAG Necessary? +# Include the boost header files, system, and filesystem libraries SET(Boost_USE_STATIC_LIBS OFF) SET(Boost_USE_STATIC_RUNTIME OFF) -FIND_PACKAGE( Boost COMPONENTS program_options filesystem system REQUIRED) +FIND_PACKAGE( Boost COMPONENTS filesystem system REQUIRED) SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${Boost_INCLUDE_DIR}) -SET(LIBS ${LIBS} ${Boost_PROGRAM_OPTIONS_LIBRARY}) -SET(LIBS ${LIBS} ${Boost_SYSTEM_LIBRARY}) SET(LIBS ${LIBS} ${Boost_FILESYSTEM_LIBRARY}) - -# find cyclopts and link to it -FIND_PACKAGE( CYCLOPTS REQUIRED ) -SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${CYCLOPTS_INCLUDE_DIR}) -set(LIBS ${LIBS} ${CYCLOPTS_LIBRARY}) -#MESSAGE("cyclopts include: ${CYCLOPTS_INCLUDE_DIR}") -#MESSAGE("cyclopts lib: ${CYCLOPTS_LIBRARY}") - -# find coin and link to it -FIND_PACKAGE( COIN REQUIRED ) -SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} ${COIN_INCLUDE_DIRS}) -set(LIBS ${LIBS} ${COIN_LIBRARIES}) +SET(LIBS ${LIBS} ${Boost_SYSTEM_LIBRARY}) # include the model directories SET(CYCAMORE_INCLUDE_DIR ${CYCAMORE_INCLUDE_DIR} Testing ) @@ -174,6 +168,7 @@ INCLUDE(CPack) SET(ROOT_DIR ${CYCLUS_ROOT_DIR}) SET(PROJ_DIR ${PROJECT_BINARY_DIR}) +SET(CORE_SHARE_DIR ${CYCLUS_CORE_SHARE_DIR}) CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/post_install/postinstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/post_install/postinstall.cmake" @ONLY) diff --git a/src/Models/Facility/BatchReactor/BatchReactor.cpp b/src/Models/Facility/BatchReactor/BatchReactor.cpp index a3c69b445f..7c55feeafb 100644 --- a/src/Models/Facility/BatchReactor/BatchReactor.cpp +++ b/src/Models/Facility/BatchReactor/BatchReactor.cpp @@ -34,9 +34,9 @@ BatchReactor::BatchReactor() : cycle_timer_(0), phase_(INIT) { - preCore_.makeUnlimited(); - inCore_.makeUnlimited(); - postCore_.makeUnlimited(); + preCore_.setCapacity(kBuffInfinity); + inCore_.setCapacity(kBuffInfinity); + postCore_.setCapacity(kBuffInfinity); if (phase_names_.size() < 1) setUpPhaseNames(); } diff --git a/src/Models/Facility/BatchReactor/BatchReactorTests.cpp b/src/Models/Facility/BatchReactor/BatchReactorTests.cpp index b7bcf5816b..1d459afa22 100644 --- a/src/Models/Facility/BatchReactor/BatchReactorTests.cpp +++ b/src/Models/Facility/BatchReactor/BatchReactorTests.cpp @@ -99,26 +99,29 @@ TEST_F(BatchReactorTest,initialstate) EXPECT_EQ(cost,src_facility->productionCost(commod)); } -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(BatchReactorTest,clone) { - Model::loadModule("Facility","BatchReactor"); - src_facility->setModelImpl("BatchReactor"); - BatchReactor* new_facility = dynamic_cast(src_facility->clone()); - EXPECT_EQ( lencycle, new_facility->cycle_length() ); - EXPECT_EQ( lencycle, new_facility->refuel_delay() ); - EXPECT_EQ( in_loadcore, new_facility->in_core_loading() ); - EXPECT_EQ( out_loadcore, new_facility->out_core_loading() ); - EXPECT_EQ( nbatch, new_facility->batches_per_core() ); - EXPECT_EQ(in_commod,new_facility->in_commodity()); - EXPECT_EQ(out_commod,new_facility->out_commodity()); - EXPECT_EQ(in_recipe,new_facility->in_recipe()); - EXPECT_EQ(out_recipe,new_facility->out_recipe()); + BatchReactor* cloned_fac = new BatchReactor(); + cloned_fac->cloneModuleMembersFrom(src_facility); + + + EXPECT_EQ( lencycle, cloned_fac->cycle_length() ); + EXPECT_EQ( lencycle, cloned_fac->refuel_delay() ); + EXPECT_EQ( in_loadcore, cloned_fac->in_core_loading() ); + EXPECT_EQ( out_loadcore, cloned_fac->out_core_loading() ); + EXPECT_EQ( nbatch, cloned_fac->batches_per_core() ); + EXPECT_EQ(in_commod,cloned_fac->in_commodity()); + EXPECT_EQ(out_commod,cloned_fac->out_commodity()); + EXPECT_EQ(in_recipe,cloned_fac->in_recipe()); + EXPECT_EQ(out_recipe,cloned_fac->out_recipe()); Commodity commod(commodity); - EXPECT_TRUE(new_facility->producesCommodity(commod)); - EXPECT_EQ(capacity,new_facility->productionCapacity(commod)); - EXPECT_EQ(cost,new_facility->productionCost(commod)); + EXPECT_TRUE(cloned_fac->producesCommodity(commod)); + EXPECT_EQ(capacity,cloned_fac->productionCapacity(commod)); + EXPECT_EQ(cost,cloned_fac->productionCost(commod)); + + delete cloned_fac; } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.cpp b/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.cpp index f670f5aa06..747edd6836 100644 --- a/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.cpp +++ b/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.cpp @@ -10,6 +10,7 @@ #include "GenericResource.h" #include "Material.h" #include "Timer.h" +#include "EventManager.h" #include #include @@ -22,8 +23,6 @@ using namespace boost; using boost::lexical_cast; using namespace enrichment; -// initialize table member -table_ptr EnrichmentFacility::table_ = table_ptr(new Table("Enrichment")); int EnrichmentFacility::entry_ = 0; //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -287,20 +286,6 @@ enrichment::Assays EnrichmentFacility::getAssays(mat_rsrc_ptr rsrc) return Assays(feed_assay(),product_assay,tails_assay()); } -//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EnrichmentFacility::define_table() -{ - // declare the state id columns and add it to the table - table_->addField("ENTRY","INTEGER"); - table_->addField("ID","INTEGER"); - table_->addField("Time","INTEGER"); - table_->addField("Natural_Uranium","REAL"); - table_->addField("SWU","REAL"); - agent_table->setPrimaryKey("ENTRY"); - // we've now defined the table - table_->tableDefined(); -} - //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EnrichmentFacility::recordEnrichment(double natural_u, double swu) { @@ -308,18 +293,13 @@ void EnrichmentFacility::recordEnrichment(double natural_u, double swu) LOG(LEV_DEBUG1, "EnrFac") << " * Amount: " << natural_u; LOG(LEV_DEBUG1, "EnrFac") << " * SWU: " << swu; - if ( !table_->defined() ) define_table(); - - data an_entry(++entry_), an_id(ID()), time_data(TI->time()), - nat_u_data(natural_u), swu_data(swu); - entry u_entry("ENTRY",an_entry), id("ID",an_id), time("Time",time_data), - natl_u("Natural_Uranium",nat_u_data), swu_req("SWU",swu_data); - // construct row - row aRow; - aRow.push_back(u_entry), aRow.push_back(id), aRow.push_back(time), - aRow.push_back(natl_u), aRow.push_back(swu_req); - // add the row - table_->addRow(aRow); + EM->newEvent("Enrichments") + ->addVal("ENTRY", ++entry_) + ->addVal("ID", ID()) + ->addVal("Time", TI->time()) + ->addVal("Natural_Uranium", natural_u) + ->addVal("SWU", swu) + ->record(); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.h b/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.h index 6b78eb6257..8a1ce8ad6f 100644 --- a/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.h +++ b/src/Models/Facility/EnrichmentFacility/EnrichmentFacility.h @@ -5,7 +5,6 @@ #include "FacilityModel.h" #include "MatBuff.h" -#include "Table.h" #include "Transaction.h" #include "Enrichment.h" @@ -198,10 +197,6 @@ class EnrichmentFacility : public FacilityModel */ void processOutgoingMaterial(); - /** - */ - void define_table(); - /** */ void recordEnrichment(double natural_u, double swu); @@ -220,8 +215,6 @@ class EnrichmentFacility : public FacilityModel MatBuff inventory_; - static table_ptr table_; - static int entry_; /// A list of orders to be processed on the Tock diff --git a/src/Models/Facility/EnrichmentFacility/EnrichmentFacilityTests.cpp b/src/Models/Facility/EnrichmentFacility/EnrichmentFacilityTests.cpp index 43fc7b28ba..5467d9907c 100644 --- a/src/Models/Facility/EnrichmentFacility/EnrichmentFacilityTests.cpp +++ b/src/Models/Facility/EnrichmentFacility/EnrichmentFacilityTests.cpp @@ -103,7 +103,7 @@ TEST_F(EnrichmentFacilityTest,clone) EXPECT_DOUBLE_EQ(feed_assay,cloned_fac->feed_assay()); EXPECT_DOUBLE_EQ(inv_size,cloned_fac->maxInventorySize()); EXPECT_DOUBLE_EQ(commodity_price,cloned_fac->commodity_price()); - + delete cloned_fac; } diff --git a/src/Models/Facility/SinkFacility/SinkFacilityTests.cpp b/src/Models/Facility/SinkFacility/SinkFacilityTests.cpp index 9ce3f1155d..42281e7a5b 100644 --- a/src/Models/Facility/SinkFacility/SinkFacilityTests.cpp +++ b/src/Models/Facility/SinkFacility/SinkFacilityTests.cpp @@ -13,7 +13,7 @@ void SinkFacilityTest::SetUp() { //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void SinkFacilityTest::TearDown() { - delete sink_facility; + delete src_facility; delete commod_market; } @@ -27,48 +27,51 @@ void SinkFacilityTest::initParameters() { //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void SinkFacilityTest::setUpSinkFacility() { - sink_facility = new SinkFacility(); - sink_facility->addCommodity(commod_); + src_facility = new SinkFacility(); + src_facility->addCommodity(commod_); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SinkFacilityTest, InitialState) { int time = 1; - EXPECT_DOUBLE_EQ(0.0, sink_facility->inventorySize()); + EXPECT_DOUBLE_EQ(0.0, src_facility->inventorySize()); } -// //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TEST_F(SinkFacilityTest,clone) { -// SinkFacility* new_facility = dynamic_cast(sink_facility->clone()); -// EXPECT_EQ(sink_facility->capacity(),new_facility->capacity()); -// EXPECT_EQ(sink_facility->maxInventorySize(),new_facility->maxInventorySize()); -// delete new_facility; -// } +//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +TEST_F(SinkFacilityTest,clone) { + SinkFacility* cloned_fac = new SinkFacility(); + cloned_fac->cloneModuleMembersFrom(src_facility); + + EXPECT_EQ(src_facility->capacity(),cloned_fac->capacity()); + EXPECT_EQ(src_facility->maxInventorySize(),cloned_fac->maxInventorySize()); + + delete cloned_fac; +} //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SinkFacilityTest, Print) { - EXPECT_NO_THROW(std::string s = sink_facility->str()); + EXPECT_NO_THROW(std::string s = src_facility->str()); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SinkFacilityTest, ReceiveMessage) { - msg_ptr msg = msg_ptr(new Message(sink_facility)); - EXPECT_NO_THROW(sink_facility->receiveMessage(msg)); + msg_ptr msg = msg_ptr(new Message(src_facility)); + EXPECT_NO_THROW(src_facility->receiveMessage(msg)); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SinkFacilityTest, Tick) { int time = 1; - EXPECT_DOUBLE_EQ(0.0, sink_facility->inventorySize()); - EXPECT_NO_THROW(sink_facility->handleTick(time)); - EXPECT_DOUBLE_EQ(0.0,sink_facility->inventorySize()); + EXPECT_DOUBLE_EQ(0.0, src_facility->inventorySize()); + EXPECT_NO_THROW(src_facility->handleTick(time)); + EXPECT_DOUBLE_EQ(0.0,src_facility->inventorySize()); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SinkFacilityTest, Tock) { int time = 1; - EXPECT_DOUBLE_EQ(0.0,sink_facility->inventorySize()); - EXPECT_NO_THROW(sink_facility->handleTock(time)); + EXPECT_DOUBLE_EQ(0.0,src_facility->inventorySize()); + EXPECT_NO_THROW(src_facility->handleTock(time)); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Models/Facility/SinkFacility/SinkFacilityTests.h b/src/Models/Facility/SinkFacility/SinkFacilityTests.h index 379141f0d9..cebc332677 100644 --- a/src/Models/Facility/SinkFacility/SinkFacilityTests.h +++ b/src/Models/Facility/SinkFacility/SinkFacilityTests.h @@ -20,7 +20,7 @@ FacilityModel* SinkFacilityConstructor(){ //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class SinkFacilityTest : public ::testing::Test { protected: - SinkFacility* sink_facility; + SinkFacility* src_facility; TestMarket* commod_market; std::string commod_; diff --git a/src/Models/Facility/SourceFacility/SourceFacility.cpp b/src/Models/Facility/SourceFacility/SourceFacility.cpp index 88f1139b76..d0365d22eb 100644 --- a/src/Models/Facility/SourceFacility/SourceFacility.cpp +++ b/src/Models/Facility/SourceFacility/SourceFacility.cpp @@ -103,10 +103,13 @@ void SourceFacility::handleTock(int time){ // send material if you have it now while (!ordersWaiting_.empty()) { Transaction order = ordersWaiting_.front()->trans(); + LOG(LEV_INFO3, "SrcFac") << "Order is for: " << order.resource()->quantity(); + LOG(LEV_INFO3, "SrcFac") << "Inventory is: " << inventory_.quantity(); if (order.resource()->quantity() - inventory_.quantity() > cyclus::eps()) { LOG(LEV_INFO3, "SrcFac") << "Not enough inventory. Waitlisting remaining orders."; break; } else { + LOG(LEV_INFO3, "SrcFac") << "Satisfying order."; order.approveTransfer(); ordersWaiting_.pop_front(); } @@ -127,6 +130,8 @@ void SourceFacility::receiveMessage(msg_ptr msg) { // file the order ordersWaiting_.push_front(msg); LOG(LEV_INFO5, "SrcFac") << name() << " just received an order."; + LOG(LEV_INFO5, "SrcFac") << "for " << msg->trans().resource()->quantity() + << " of " << msg->trans().commod(); } else { throw CycException("SourceFacility is not the supplier of this msg."); } diff --git a/src/Models/Facility/SourceFacility/SourceFacilityTests.cpp b/src/Models/Facility/SourceFacility/SourceFacilityTests.cpp index dbeb84ea06..c30940b946 100644 --- a/src/Models/Facility/SourceFacility/SourceFacilityTests.cpp +++ b/src/Models/Facility/SourceFacility/SourceFacilityTests.cpp @@ -41,22 +41,24 @@ TEST_F(SourceFacilityTest, InitialState) { EXPECT_DOUBLE_EQ(0.0, src_facility->inventorySize()); } -// //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TEST_F(SourceFacilityTest,clone) { -// SourceFacility* new_facility = dynamic_cast(src_facility->clone()); -// EXPECT_EQ(src_facility->commodity(),new_facility->commodity()); -// EXPECT_EQ(src_facility->capacity(),new_facility->capacity()); -// EXPECT_EQ(src_facility->maxInventorySize(),new_facility->maxInventorySize()); -// EXPECT_EQ(src_facility->recipe(),new_facility->recipe()); -// delete new_facility; -// } +//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +TEST_F(SourceFacilityTest,clone) { + SourceFacility* cloned_fac = new SourceFacility(); + cloned_fac->cloneModuleMembersFrom(src_facility); + + EXPECT_EQ(src_facility->commodity(),cloned_fac->commodity()); + EXPECT_EQ(src_facility->capacity(),cloned_fac->capacity()); + EXPECT_EQ(src_facility->maxInventorySize(),cloned_fac->maxInventorySize()); + EXPECT_EQ(src_facility->recipe(),cloned_fac->recipe()); + + delete cloned_fac; +} //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SourceFacilityTest, Print) { EXPECT_NO_THROW(std::string s = src_facility->str()); } - //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEST_F(SourceFacilityTest, ReceiveMessage) { msg_ptr msg = msg_ptr(new Message(src_facility)); @@ -82,4 +84,3 @@ TEST_F(SourceFacilityTest, Tock) { //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSTANTIATE_TEST_CASE_P(SourceFac, FacilityModelTests, Values(&SourceFacilityConstructor)); INSTANTIATE_TEST_CASE_P(SourceFac, ModelTests, Values(&SourceFacilityModelConstructor)); - diff --git a/src/Models/Facility/StorageFacility/StorageFacility.cpp b/src/Models/Facility/StorageFacility/StorageFacility.cpp index 2cd95f1e95..3f500c786f 100644 --- a/src/Models/Facility/StorageFacility/StorageFacility.cpp +++ b/src/Models/Facility/StorageFacility/StorageFacility.cpp @@ -5,7 +5,6 @@ #include "Timer.h" #include -#include #include @@ -33,13 +32,11 @@ using boost::lexical_cast; StorageFacility::StorageFacility() : out_commod_(""), in_commod_(""), - out_capacity(numeric_limits::max()), - in_capacity(numeric_limits::max()), residence_time_(0), offer_price_(0.0) { - out_buffer_.makeUnlimited(); - in_buffer_.makeUnlimited(); + out_buffer_.setCapacity(kBuffInfinity); + in_buffer_.setCapacity(kBuffInfinity); } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Models/Facility/StorageFacility/StorageFacility.h b/src/Models/Facility/StorageFacility/StorageFacility.h index 99a8d89b3d..697253a4fc 100644 --- a/src/Models/Facility/StorageFacility/StorageFacility.h +++ b/src/Models/Facility/StorageFacility/StorageFacility.h @@ -157,14 +157,6 @@ class StorageFacility : public FacilityModel */ std::string out_commod_; - /** - */ - double in_capacity_; - - /** - */ - double out_capacity_; - /** The minimum time that the stock material spends in the facility. */ diff --git a/src/Models/Market/NullMarket/NullMarket.cpp b/src/Models/Market/NullMarket/NullMarket.cpp index e863b48b59..5aa0255853 100644 --- a/src/Models/Market/NullMarket/NullMarket.cpp +++ b/src/Models/Market/NullMarket/NullMarket.cpp @@ -82,7 +82,12 @@ bool NullMarket::match_request(sortedMsgList::iterator request) offers_.erase(offer); if (requestMsg->trans().resource()->checkQuality(offerMsg->trans().resource())){ - if (requestAmt > offerAmt) { + + LOG(LEV_DEBUG1,"NulMkt") << "Comparing " << requestAmt << " >= " + << offerAmt + << ": " << (requestAmt>=offerAmt); + + if (requestAmt >= offerAmt) { // put a new message in the order stack // it goes down to supplier offerMsg->trans().matchWith(requestMsg->trans()); @@ -106,7 +111,7 @@ bool NullMarket::match_request(sortedMsgList::iterator request) requestAmt -= offerAmt; } - else if (offerAmt >= requestAmt){ + else { // split offer // queue a new order diff --git a/src/Testing/CycamoreUnitTestDriver.cpp b/src/Testing/CycamoreUnitTestDriver.cpp index 82d9c821dc..36a6a24116 100644 --- a/src/Testing/CycamoreUnitTestDriver.cpp +++ b/src/Testing/CycamoreUnitTestDriver.cpp @@ -3,14 +3,10 @@ #include -#include "BookKeeper.h" #include "Env.h" #include "Logger.h" int main(int argc, char* argv[]) { - // turn normal logging off, we will test it - BI->turnLoggingOff(); - // tell ENV the path between the cwd and the cyclus executable std::string path = Env::pathBase(argv[0]); Env::setCyclusRelPath(path); diff --git a/src/post_install/postinstall.cmake.in b/src/post_install/postinstall.cmake.in index 1d852a9ad4..a85049004b 100644 --- a/src/post_install/postinstall.cmake.in +++ b/src/post_install/postinstall.cmake.in @@ -1,5 +1,5 @@ SET(CYCLUS_ROOT_DIR "@ROOT_DIR@") -SET(CYCLUS_CORE_SHARE_DIR "${CYCLUS_ROOT_DIR}/share") +SET(CYCLUS_CORE_SHARE_DIR "@CORE_SHARE_DIR@") SET(PROJECT_BINARY_DIR "@PROJ_DIR@") macro(find_modules _type) @@ -8,7 +8,7 @@ macro(find_modules _type) FOREACH(dir ${all_valid_subdirs}) STRING(REPLACE "${CYCLUS_ROOT_DIR}/lib/Models/${_type}/" "" model_name "${dir}" ) SET(${_type}_REFS ${${_type}_REFS} "") - SET(RNG_INCLUDES ${RNG_INCLUDES} "") + SET(RNG_INCLUDES ${RNG_INCLUDES} "") ENDFOREACH(dir) endmacro()