Skip to content

Commit 4c4e826

Browse files
teubertjason-watkins
authored andcommitted
Release 2.0.0 (#117)
Changes: - Refactored GSAP to operate asynchronously, including automatic thread management to perform calculations on multiple threads. - Added "simple" operational mode for resource constrained hardware. - Replaced ProgData with discrete ProgEvent and SysTraj messages - Created Load Estimator interface- for custom estimation of future loading - Implemented savepts- specified moments in a prediction to report the predicted state - Various bug fixes and efficiency improvements
1 parent 68a33f4 commit 4c4e826

File tree

324 files changed

+1002564
-516600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+1002564
-516600
lines changed

.appveyor.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
image: Visual Studio 2017
2+
3+
platform:
4+
- x64
5+
6+
configuration:
7+
- Release
8+
9+
before_build:
10+
- cd tests
11+
- cmake -G "Visual Studio 15 2017 Win64" .
12+
13+
build:
14+
project: $(APPVEYOR_BUILD_FOLDER)\tests\$(APPVEYOR_PROJECT_NAME)-tests.sln
15+
16+
test_script:
17+
- 'cd %APPVEYOR_BUILD_FOLDER%\tests\bin'
18+
- '.\tests.exe'

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ IndentWidth: 4
44
Language: Cpp
55
AccessModifierOffset: -4
66
AlignAfterOpenBracket: Align
7-
AlignConsecutiveAssignments: true
7+
AlignConsecutiveAssignments: false
88
AlignConsecutiveDeclarations: false
99
AlignEscapedNewlines: DontAlign
1010
AlignOperands: true

.codecov.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
comment:
2+
layout: "reach, diff, flags, files"
3+
behavior: default
4+
require_changes: false # if true: only post the comment if coverage changes
5+
require_base: no # [yes :: must have a base report to post]
6+
require_head: no # [yes :: must have a head report to post]
7+
branches: null
8+
coverage:
9+
status:
10+
project:
11+
default:
12+
target: auto
13+
threshold: null
14+
base: pr
15+
patch:
16+
default:
17+
target: auto
18+
threshold: null
19+
base: pr

.travis.yml

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: cpp
22

3-
# Use reasonable compiler versions
43
matrix:
54
include:
6-
- os: linux
5+
- name: "Linux/GCC"
6+
os: linux
77
compiler: gcc
88
addons:
99
apt:
@@ -14,40 +14,52 @@ matrix:
1414
- lcov
1515
env:
1616
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
17-
- COMPENV="gcc"
18-
- os: linux
17+
script:
18+
- cmake -DCoverage=ON .. $GENERATOR
19+
- cmake --build .
20+
- lcov -q -c -i -d ./gsap -o coverage_base.info
21+
- pushd bin
22+
- ./tests
23+
- popd
24+
after_success:
25+
# Create lcov report
26+
- lcov -q -c -d ./gsap -o coverage_test.info
27+
- lcov -q -a coverage_base.info -a coverage_test.info -o coverage.info
28+
- lcov -q -r coverage.info '/usr/*' --o coverage.info # filter system-files
29+
# Upload to CodeCov
30+
- bash <(curl -s https://codecov.io/bash) -f coverage.info
31+
- name: "Linux/Clang"
32+
os: linux
1933
compiler: clang
2034
addons:
2135
apt:
2236
sources:
2337
- llvm-toolchain-trusty-5.0
2438
packages:
2539
- clang-5.0
26-
- lcov
2740
env:
2841
- MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
29-
- COMPENV="clang"
30-
- os: osx
42+
- name: "macOS/Clang"
43+
os: osx
3144
compiler: clang
3245
env:
3346
- MATRIX_EVAL=""
34-
- COMPENV="clang"
35-
- os: osx
47+
- name: "macOS/Xcode"
48+
os: osx
3649
env:
3750
- MATRIX_EVAL="GENERATOR='-G Xcode'"
38-
- COMPENV=""
3951

4052
before_install:
4153
- eval "${MATRIX_EVAL}"
4254

43-
script:
55+
before_script:
56+
- pushd tests
4457
- mkdir build
45-
- mkdir bin
4658
- pushd build
47-
- cmake ..
59+
60+
script:
61+
- cmake .. $GENERATOR
4862
- cmake --build .
49-
- popd
5063
- pushd bin
51-
- ./supportTests
52-
- ./frameworkTests
53-
- ./commCollectionTests
64+
- ./tests
65+
- popd

CMakeLists.txt

+110-112
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,122 @@
11
cmake_minimum_required(VERSION 2.8)
22

3-
project(GSAP)
4-
5-
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin/)
6-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
7-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
8-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
9-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
10-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
11-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
12-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
13-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
14-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
15-
16-
# Build option for enabling compiler and linker flags for gathering coverage data
17-
# In command line, set option this way:
18-
# cmake -DCoverage=ON <build folder>
3+
# Build option for enabling compiler and linker flags for gathering coverage data
4+
# In command line, set option this way:
5+
# cmake -DCoverage=ON <build folder>
196
option(Coverage "Coverage" OFF)
207

21-
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
22-
# -g: Produce debugging information
23-
# -O3: Optimize as much as possible while remaning standards compliant
24-
# -O0: Disable optimizations
25-
# -std: Determine the language standard.
26-
# -Wall: Enables all the warnings about constructions that some users consider questionable
27-
# -Wcast-qual: Warn whenever a pointer is cast so as to remove a type qualifier from the target type
28-
# -Werror: Make all warnings into errors
29-
# -Weffc++: Warn about violations of some guidelines from Scott Meyers' Effective C++ (Note 2016-07-13: Currently removed because it warns about some things that are perfectly safe)
30-
# -Wextra: Enables some extra warning flags that are not enabled by -Wall
31-
# -Wfloat-equal: Warn if floating-point values are used in equality comparisons.
32-
# -Wformat: Check calls to printf and scanf, etc.
33-
# -Winline: Warn if a function that is declared as inline cannot be inlined
34-
# -Wold-style-cast: Warn on C-style casts
35-
# -Wpedantic: Issue all the warnings demanded by strict ISO C and ISO C++
36-
# -Wshadow: Warn whenever a local variable or type declaration shadows another variable, parameter, type, or class member
37-
# -Wsign-conversion: Warn for implicit conversions that may change the sign of an integer value
38-
# -Wswitch-default: Warn whenever a switch statement does not have a default case.
39-
# -Wno-unknown-pragmas: (2016-07-13) Temporarily added to disable warnings about #pragma unused
40-
set(CMAKE_CXX_FLAGS "-std=c++11 -pthread")
41-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-aliasing")
42-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wcast-qual -Wextra -Wfloat-equal")
43-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wold-style-cast -Wpedantic -Wshadow")
44-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion -Wswitch-default -Wno-unknown-pragmas")
45-
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Winline")
46-
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Werror")
47-
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
48-
# -g: Produce debugging information
49-
# -O3: Optimize as much as possible while remaning standards compliant
50-
# -Og: Enable optimizations that don't interfere with debugging
51-
# -std: Determine the language standard.
52-
# -Wall: Enables all the warnings about constructions that some users consider questionable
53-
# -Wcast-qual: Warn whenever a pointer is cast so as to remove a type qualifier from the target type
54-
# -Werror: Make all warnings into errors
55-
# -Weffc++: Warn about violations of some guidelines from Scott Meyers' Effective C++ (Note 2016-07-13: Currently removed because it warns about some things that are perfectly safe)
56-
# -Wextra: Enables some extra warning flags that are not enabled by -Wall
57-
# -Wfloat-equal: Warn if floating-point values are used in equality comparisons.
58-
# -Wformat: Check calls to printf and scanf, etc.
59-
# -Winline: Warn if a function that is declared as inline cannot be inlined
60-
# -Wold-style-cast: Warn on C-style casts
61-
# -Wpedantic: Issue all the warnings demanded by strict ISO C and ISO C++
62-
# -Wshadow: Warn whenever a local variable or type declaration shadows another variable, parameter, type, or class member
63-
# -Wsign-conversion: Warn for implicit conversions that may change the sign of an integer value
64-
# -Wswitch-default: Warn whenever a switch statement does not have a default case.
65-
# -Wno-unknown-pragmas: (2016-07-13) Temporarily added to disable warnings about #pragma unused
66-
set(CMAKE_CXX_FLAGS "-std=c++11 -pthread")
67-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstrict-aliasing")
68-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wcast-qual -Wextra -Wfloat-equal")
69-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat -Wold-style-cast -Wpedantic -Wshadow")
70-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion -Wswitch-default -Wno-unknown-pragmas")
71-
72-
if(Coverage)
73-
# If coverage option enabled, set compiler and linker flags to gather coverage data
74-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
75-
set(CMAKE_EXE_LINKER_FLAGS "-lgcov")
76-
endif()
77-
78-
set(CMAKE_CXX_FLAGS_DEBUG "-g -Og -Winline")
79-
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Werror")
80-
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
81-
# /EHsc: Specifies the model of exception handling.
82-
# /GL: Enables whole program optimization.
83-
# /Gm: Enables minimal rebuild.
84-
# /GS: Buffers security check.
85-
# /MD: Creates a multithreaded DLL using MSVCRT.lib.
86-
# /MDd: Creates a debug multithreaded DLL using MSVCRTD.lib.
87-
# /O2: Creates fast code.
88-
# /Od: Disables optimization.
89-
# /Oi: Generates intrinsic functions.
90-
# /RTC1: Enables run-time error checking.
91-
# /sdl: Enables additional (Windows-specific) security features and warnings.
92-
# /W4: Sets which warning level to output.
93-
# /wd: Disable warning
94-
# /Zi: Generates complete debugging information.
95-
set(CMAKE_CXX_FLAGS "/EHsc /GS /sdl- /W4 /wd\"4996\" /Zi")
96-
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /MDd /Od /RTC1")
97-
set(CMAKE_CXX_FLAGS_RELEASE "/GL /Gm- /MD /O2 /Oi")
98-
else()
99-
message(FATAL_ERROR "${CMAKE_CXX_COMPILER_ID} is not recognized.")
100-
endif()
101-
1028
# Check command line to see if OpenMP is to be used.
1039
option(UseOpenMP "UseOpenMP" FALSE)
10410

10511
# Build with OpenMP if desired, and package can be found.
10612
if (UseOpenMP)
107-
message(STATUS "Attempting to find OpenMP package...")
108-
find_package(OpenMP)
109-
if (OPENMP_FOUND)
110-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
13+
message(STATUS "Attempting to find OpenMP package...")
14+
find_package(OpenMP)
15+
if (OPENMP_FOUND)
16+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
11117
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
112-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
113-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D USING_OPENMP")
114-
message(STATUS "Added OpenMP to buildsystem")
115-
else()
116-
message(FATAL_ERROR "Command line asked for OpenMP, but package couldn't be found!")
117-
endif()
18+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
19+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D USING_OPENMP")
20+
message(STATUS "Added OpenMP to buildsystem")
21+
else()
22+
message(FATAL_ERROR "Command line asked for OpenMP, but package couldn't be found!")
23+
endif()
11824
endif()
11925

120-
#Libraries
121-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/support/)
122-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/framework/)
123-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Test/)
124-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/example/)
26+
set(HEADERS
27+
inc/BenchmarkTimer.h
28+
inc/CompositeSavePointProvider.h
29+
inc/ConfigMap.h
30+
inc/Contracts.h
31+
inc/DataPoint.h
32+
inc/DataPoints.h
33+
inc/DataStore.h
34+
inc/Datum.h
35+
inc/DynamicArray.h
36+
inc/AsyncPrognoser.h
37+
inc/AsyncPrognoserBuilder.h
38+
inc/Exceptions.h
39+
inc/Factory.h
40+
inc/GaussianVariable.h
41+
inc/ISavePointProvider.h
42+
inc/Loading/ConstLoadEstimator.h
43+
inc/Loading/LoadEstimator.h
44+
inc/Loading/LoadEstimatorFactory.h
45+
inc/Loading/MovingAverageLoadEstimator.h
46+
inc/Matrix.h
47+
inc/Messages/IMessageProcessor.h
48+
inc/Messages/IMessagePublisher.h
49+
inc/Messages/Message.h
50+
inc/Messages/MessageBus.h
51+
inc/Messages/MessageClock.h
52+
inc/Messages/MessageId.h
53+
inc/Messages/MessageWatcher.h
54+
inc/Messages/ProgEventMessage.h
55+
inc/Messages/UDataMessage.h
56+
inc/Messages/WaypointMessage.h
57+
inc/ModelBasedAsyncPrognoserBuilder.h
58+
inc/ModelBasedPrognoser.h
59+
inc/Models/BatteryModel.h
60+
inc/Models/SystemModel.h
61+
inc/Models/SystemModelFactory.h
62+
inc/Models/PrognosticsModel.h
63+
inc/Models/PrognosticsModelFactory.h
64+
inc/Observers/AsyncObserver.h
65+
inc/Observers/Observer.h
66+
inc/Observers/ObserverFactory.h
67+
inc/Observers/ParticleFilter.h
68+
inc/Observers/UnscentedKalmanFilter.h
69+
inc/Predictors/AsyncPredictor.h
70+
inc/Predictors/MonteCarloPredictor.h
71+
inc/Predictors/Predictor.h
72+
inc/Predictors/PredictorFactory.h
73+
inc/PContainer.h
74+
inc/Point3D.h
75+
inc/ProgEvent.h
76+
inc/Prognoser.h
77+
inc/PrognoserFactory.h
78+
inc/Singleton.h
79+
inc/StatisticalTools.h
80+
inc/StringUtils.h
81+
inc/Trajectory/AsyncTrajectoryService.h
82+
inc/Trajectory/ITrajectoryCorrelator.h
83+
inc/Trajectory/TrajectoryService.h
84+
inc/ThreadSafeLog.h
85+
inc/UData.h
86+
inc/UDataInterfaces.h
87+
)
88+
89+
set(SRCS
90+
src/ConfigMap.cpp
91+
src/DataPoint.cpp
92+
src/DataPoints.cpp
93+
src/AsyncPrognoserBuilder.cpp
94+
src/GaussianVariable.cpp
95+
src/Loading/ConstLoadEstimator.cpp
96+
src/Loading/GaussianLoadEstimator.cpp
97+
src/Loading/MovingAverageLoadEstimator.cpp
98+
src/Matrix.cpp
99+
src/Messages/EmptyMessage.cpp
100+
src/Messages/Message.cpp
101+
src/Messages/MessageBus.cpp
102+
src/Messages/MessageId.cpp
103+
src/Messages/WaypointMessage.cpp
104+
src/ModelBasedAsyncPrognoserBuilder.cpp
105+
src/ModelBasedPrognoser.cpp
106+
src/Models/BatteryModel.cpp
107+
src/Observers/AsyncObserver.cpp
108+
src/Observers/ParticleFilter.cpp
109+
src/Observers/UnscentedKalmanFilter.cpp
110+
src/PContainer.cpp
111+
src/Predictors/AsyncPredictor.cpp
112+
src/Predictors/MonteCarloPredictor.cpp
113+
src/StatisticalTools.cpp
114+
src/ThreadSafeLog.cpp
115+
src/Trajectory/AsyncTrajectoryService.cpp
116+
src/Trajectory/TrajectoryService.cpp
117+
src/UData.cpp
118+
src/UDataInterfaces.cpp
119+
)
120+
121+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc/)
122+
add_library(gsap ${HEADERS} ${SRCS})

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ here](https://github.com/nasa/GSAP/wiki)** </div></font>
77
The Generic Software Architecture for Prognostics (GSAP) is a framework for
88
applying prognostics. It makes applying prognostics easier by implementing many
99
of the common elements across prognostic applications. The standard interface
10-
enables reuse of prognostic algorithms and models across using the GSAP
10+
enables reuse of prognostic algorithms and models across using the GSAP
1111
framework.
1212

13+
There are two operational modes for GSAP: 'async' and 'simple'. These are both described below:
14+
* 'async': Asynchronous GSAP. This takes advantage of parallization, including automatic thread management to perform calculations on multiple threads.
15+
* 'simple': Simple single-threaded GSAP. Resulting prognostics application is smaller and simplier, but does not take advantage of multi-threading. Ideal for resource constrained hardware.
16+
1317
![GSAP Layers](images/Layers.png)
1418

1519
The GSAP framework is used through the creation of communicators, prognosers, or
@@ -19,7 +23,7 @@ described further below:
1923

2024
* **Communicators**:
2125

22-
Communicators are used to communicate data with the outside world. These
26+
Communicators are used to communicate data with the outside world. These
2327
function as interfaces with various data sources and sinks. Some examples could
2428
be a playback agent that reads from a file, a GUI for displaying prognostic
2529
results, an automated report generator, or a client that connects into a network
@@ -59,7 +63,7 @@ All contributions are welcome! If you are having problems with the plugin, pleas
5963

6064
## Notices
6165

62-
Copyright ©2016-2018 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
66+
Copyright ©2016, 2019 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
6367

6468
No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF
6569
ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED

0 commit comments

Comments
 (0)