首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做ECS34、C++编程设计代写
项目预算:
开发周期:
发布时间:
要求地区:
ECS34 WQ24 February 17, 2024
Project 4
1 of 9
Project 4
Due March 11, 2024 at 9:00 PM
You will be working with a partner for this project. This specification is subject to change at any
time for additional clarification.
Desired Outcomes
• Exposure to GoogleTest and Google Mock
• Exposure to Expat XML library
• Exposure to Open Street Map file formats
• Use of git repository
• Exposure to documenting code in Markdown
• An understanding of how to develop Makefiles that build and execute unit tests
• An understanding of delimiter-separated-value files
• An understanding of XML files
• An understanding of Dijkstra’s Algorithm
• An understanding of how to integrate a third-party C library in C++
Project Description
Navigation is a critical to modern society. Once source and destination coordinates are translated
to vertices, the shortest or fastest path can be calculated to route the user to their destination. The
goal of your project is to write a program that will be able to parse an OpenStreetMap (OSM) file
for an area and then to find shortest/fastest routes as fast as possible. Additionally, the goal is to
include multiple methods of transportation (biking vs walking and bus) in your search for fastest
routes. You will be building a program that can find paths, print and save them. You will be
building upon the classes from project 3. Some of the capabilities are extra credit, see the extra
credit section to determine what is required, and what is extra credit.
The CBusSystemIndexer class you will be developing will index the CBusSystem
information provided for ease of lookup of stops and routes. It will be helpful class in developing
some of the later components of the project.
// CBusSystemIndexer member functions
// Constructor for the Bus System Indexer
CBusSystemIndexer(std::shared_ptr
bussystem);
// Destructor for the Bus System Indexer
~CBusSystemIndexer();
// Returns the number of stops in the CBusSystem being indexed
std::size_t StopCount() const noexcept;
// Returns the number of routes in the CBusSystem being indexed
std::size_t RouteCount() const noexcept;
ECS34 WQ24 February 17, 2024
Project 4
2 of 9
// Returns the SStop specified by the index where the stops are sorted by
// their ID, nullptr is returned if index is greater than equal to
// StopCount()
std::shared_ptr
SortedStopByIndex(std::size_t index) const noexcept;
// Returns the SRoute specified by the index where the routes are sorted by
// their Name, nullptr is returned if index is greater than equal to
// RouteCount()
std::shared_ptr
SortedRouteByIndex(std::size_t index) const noexcept;
// Returns the SStop associated with the specified node ID, nullptr is
// returned if no SStop associated with the node ID exists
std::shared_ptr
StopByNodeID(TNodeID id) const noexcept;
// Returns true if at least one route exists between the stops at the src and
// dest node IDs. All routes that have a route segment between the stops at
// the src and dest nodes will be placed in routes unordered set.
bool RoutesByNodeIDs(TNodeID src, TNodeID dest,
std::unordered_set
> &routes) const noexcept;
// Returns true if at least one route exists between the stops at the src and
// dest node IDs.
bool RouteBetweenNodeIDs(TNodeID src, TNodeID dest) const noexcept;
The CDijkstraPathRouter class you will be developing will implement the
CPathRouter abstract interface. The CDijkstraPathRouter class will find the shortest
path between source and destination vertices if one exists. At the core the shortest path finding
algorithm must utilize Dijkstra’s Algorithm, though you may optimize where available. The vertex
IDs do not have to match the node or stop IDs used by the other classes. You will need to write a
test program for the CDijkstraPathRouter.
// CDijkstraPathRouter member functions
// Constructor for the Dijkstra Path Router
CDijkstraPathRouter();
// Destructor for the Dijkstra Path Router
~CDijkstraPathRouter();
// Returns the number of vertices in the path router
std::size_t VertexCount() const noexcept;
// Adds a vertex with the tag provided. The tag can be of any type.
TVertexID AddVertex(std::any tag) noexcept;
// Gets the tag of the vertex specified by id if id is in the path router.
// A std::any() is returned if id is not a valid vertex ID.
std::any GetVertexTag(TVertexID id) const noexcept;
// Adds an edge between src and dest vertices with a weight of weight. If
// bidir is set to true an additional edge between dest and src is added. If
// src or dest nodes do not exist, or if the weight is negative the AddEdge
// will return false, otherwise it returns true.
bool AddEdge(TVertexID src, TVertexID dest, double weight, bool bidir =
false) noexcept;
ECS34 WQ24 February 17, 2024
Project 4
3 of 9
// Allows the path router to do any desired precomputation up to the deadline
bool Precompute(std::chrono::steady_clock::time_point deadline) noexcept;
// Returns the path distance of the path from src to dest, and fills out path
// with vertices. If no path exists NoPathExists is returned.
double FindShortestPath(TVertexID src, TVertexID dest, std::vector
&path) noexcept;
The CDijkstraTransportationPlanner class you will be developing will implement
the CTransportationPlanner abstract interface. You will build upon the street map, bus
system, bus system indexer, and path router to implement the transportation planner. The
configuration of the transportation system will be provided as a parameter to the constructor.
// CDijkstraTransportationPlanner member functions
// Constructor for the Dijkstra Transportation Planner
CDijkstraTransportationPlanner(std::shared_ptr
config);
// Destructor for the Dijkstra Transportation Planner
~CDijkstraTransportationPlanner();
// Returns the number of nodes in the street map
std::size_t NodeCount() const noexcept override;
// Returns the street map node specified by index if index is less than the
// NodeCount(). nullptr is returned if index is greater than or equal to
// NodeCount(). The nodes are sorted by Node ID.
std::shared_ptr
SortedNodeByIndex(std::size_t index) const
noexcept override;
// Returns the distance in miles between the src and dest nodes of the
// shortest path if one exists. NoPathExists is returned if no path exists.
// The nodes of the shortest path are filled in the path parameter.
double FindShortestPath(TNodeID src, TNodeID dest, std::vector< TNodeID >
&path) override;
// Returns the time in hours for the fastest path between the src and dest
// nodes of the if one exists. NoPathExists is returned if no path exists.
// The transportation mode and nodes of the fastest path are filled in the
// path parameter.
double FindFastestPath(TNodeID src, TNodeID dest, std::vector< TTripStep >
&path) override;
// Returns true if the path description is created. Takes the trip steps path
// and converts it into a human readable set of steps.
bool GetPathDescription(const std::vector< TTripStep > &path, std::vector<
std::string > &desc) const override;
ECS34 WQ24 February 17, 2024
Project 4
4 of 9
The CTransportationPlannerCommandLine class you will be developing will
implement the command line interface for the transplanner program. The transplanner
program is a command line program that will take in commands and execute what is requested.
// CTransportationPlannerCommandLine member functions
// Constructor for the Transportation Planner Command Line
CTransportationPlannerCommandLine(std::shared_ptr
cmdsrc,
std::shared_ptr
outsink,
std::shared_ptr
errsink,
std::shared_ptr
results,
std::shared_ptr
planner);
// Destructor for the Transportation Planner Command Line
~CTransportationPlannerCommandLine();
// Processes the commands input to the
bool ProcessCommands();
An example CSV and OSM file set will be provided, the files will be used in project 4. Your tests
should be built with them in mind, but you shouldn’t load the files as part of the tests.
The Makefile you develop needs to implement the following:
• Must create obj directory for object files (if doesn’t exist)
• Must create bin directory for binary files (if doesn’t exist)
• Must compile cpp files using C++17
• Must link string utils and string utils tests object files to make teststrutils executable
• Must link StringDataSource and StringDataSourceTest object files to make
teststrdatasource executable
• Must link FileDataSource, FileDataSink, FileDataFactory and
FileDataSSTest object files to make testfiledatass executable
• Must link StringDataSink and StringDataSinkTest object files to make
teststrdatasink executable
• Must link DSV reader/writer and DSV tests object files to make testdsv executable
• Must link XML reader/writer and XML tests object files to make testxml executable
• Must link KMLWriter and KMLTest object files to make testkml executable
• Must link CSVBusSystem and CSVBusSystem tests object files to make testcsvbs
executable
• Must link OpenStreetMap and OpenStreetMap tests object files to make testosm
executable
• Must link DijkstraPathRouter and DijkstraPathRouter tests object files to
make testdpr executable
• Must link BusSystemIndexer and CSVBusSystemIndexerTest object files to
make testcsvbsi executable
• Must link TransportationPlannerCommandLine and TPCommandLineTest
object files to make testtpcl executable
ECS34 WQ24 February 17, 2024
Project 4
5 of 9
• Must link CSVOSMTransportationPlannerTest,
DijkstraTransportationPlanner and other required object files to make
testtp executable
• Must execute the teststrutils, teststrdatasource, teststrdatasink,
testfiledatass, testdsv, testxml, testcsvbs, testosm, testdpr,
testcsvbsi, testtp, and testtpcl test executables
• Must build the transplanner and speedtest executables once all tests pass
• Must provide a clean that will remove the obj and bin directories
Provided Helper Classes/Tests
• FileDataSource, FileDataSink, and FileDataFactory provide classes for
accessing files/directories as sources/sinks
• StandardDataSource, StandardDataSink, and StandardDataErrorSink
provide classes for accessing standard I/O as sources/sinks
• STransportationPlannerConfig provides a basic implementation for the
configuration interface with the default assumptions
• GeographicUtils provides static methods for calculating distance, bearings, etc. and
will be necessary for calculating the shortest/fastest paths
• KMLWriter and kmlout files provide a class and program that can convert saved paths
into KML files that can be used on google maps
• CSVBusSystemIndexterTest, CSVOSMTransporationPlannerTest,
FileDataSSTest, and TPCommandLineTest provide google tests for much of what
you need to develop
Important Assumptions
• For shortest path assume only follow direction specified in the street map, so you can't go
backward along a "oneway"
• For fastest path, assume can walk both directions regardless of "oneway", bike/bus must
follow "oneway". Also, you cannot bike along paths that specify "bicycle" as "no"
• Assume busses route will take shortest path (don't worry about calculating fastest path)
• Walk speed must be taken from config WalkSpeed function (default is 3mph)
• Bike speed must be taken from config BikeSpeed function (default is 8mph)
• Bus follows speed limit and DefaultSpeedLimit function will provide the assumed
speed limit if the way does not specify it (default is 25 mph)
• You cannot take your bike on the bus, so if you take the bus you must walk to it
• When creating the path description:
o The direction must be based upon beginning point on a street to the end point of
travelling on the street, not the beginning point and the next point
o The direction is listed as along if the street name is known, and toward if the street
name is not known, but the next street is known
o When there are multiple options for taking a bus, the bus that will go the furthest
will be taken. If multiple options are available, the bus with the earliest sorted name
will be taken
ECS34 WQ24 February 17, 2024
Project 4
6 of 9
You must have a docs directory that contains Markdown (.md) files that document the
CPathRouter, CDijkstraPathRouter, CTransportationPlanner,
CDijkstraTransportationPlanner, and
CTransportationPlannerCommandLine classes and their use. The documentation of
each class and function should be consistent. Code examples are excellent for documenting the
use of the developed classes.
You can unzip the given tgz file with utilities on your local machine, or if you upload the file to
the CSIF, you can unzip it with the command:
tar -xzvf proj4given.tgz
You must submit the source file(s), your Makefile, README file, and .git directory in a tgz
archive. Do a make clean prior to zipping up your files so the size will be smaller. You can tar
gzip a directory with the command:
tar -zcvf archive-name.tgz directory-name
A working example can be found on the CSIF in /home/cjnitta/ecs34/transplanner.
Your program is expected to have the same interface as the working example. The full interface
can be listed by typing help after launching the program. A program that can convert saved paths
into KML files has also been provided /home/cjnitta/ecs34/kmlout. Directions of how
to view a KML file in google maps can be found at https://youtu.be/1HqQuHeGa38.
You should avoid using existing source code as a primer that is currently available on the Internet.
You must specify in your readme file any sources of code that you have viewed to help you
complete this project. All class projects will be submitted to MOSS to determine if students have
excessively collaborated. Excessive collaboration, or failure to list external code sources will result
in the matter being referred to Student Judicial Affairs.
Recommended Approach
The recommended approach is as follows:
1. Create a git repository and add your project 3 and provided files.
2. Update your project 3 Makefile to meet the specified requirements. The order of the tests
to be run should the teststrutils, teststrdatasource, teststrdatasink,
testfiledatass, testdsv, testxml, testcsvbs, testosm, testdpr,
testcsvbsi, testtp, and testcl
3. Verify that your string utils, string data source, string data sink, file data source/sink, DSV
reader, DSV writer, XML reader, XML writer, CSV Bus System, OSM, KML writer, tests
all compile, run and pass.
4. Create the files and skeleton functions for BusSystemIndexer.cpp, DijkstraPathRouter.cpp,
DijkstraPathRouterTest.cpp, DijkstraTransportationPlanner.cpp,
TransportationPlannerCommandLine.cpp and transplanner.cpp.
ECS34 WQ24 February 17, 2024
Project 4
7 of 9
5. Write tests for the CDijkstraPathRouter class. Each test you write should fail, make
sure to have sufficient coverage of the possible data input. This will complete the test files
as others will be provided for you.
6. Once tests have been written that fail with the initial skeleton functions, begin writing your
CBusSystemIndexer functions. It should be noted that since the
CBusSystemIndexer, CDijkstraPathRouter, and
CTransportationPlannerCommandLine classes do not rely on one another for
testing, they could potentially be done in any order.
7. Once the CBusSystemIndexer class is complete, begin writing your
CDijkstraPathRouter functions.
8. Once the CDijkstraPathRouter class is complete, begin writing your
CDijkstraTransportationPlanner functions.
NOTE: the GetPathDescription function is extra credit!
9. Once the CDijkstraTransportationPlanner class is complete, begin writing
your CTransportationPlannerCommandLine functions.
10. Once the CTransportationPlannerCommandLine and
CDijkstraTransportationPlanner classes are complete, begin writing the
transplanner program. There will be requirement to parse the command arguments
but setting up of the config to create the CTransportationPlannerCommandLine
is mainly what is needed.
Grading
The point breakdown can be seen in the table below. Make sure your code compiles on the CSIF
as that is where it is expected to run. You will make an interactive grading appointment to have
your assignment graded. You must have a working webcam for the interactive grading
appointment. Project submissions received 24hr prior to the due date/time will received 10% extra
credit. The extra credit bonus will drop off at a rate of 0.5% per hour after that, with no additional
credit being received for submissions within 4hr of the due date/time.
Points Description
10 Has git repository with appropriate number of commits
5 Has Makefile and submission compiles
5 Makefile meets specified requirements
5 Has DijkstraPathRouter google tests that fail with initial skeleton
functions
5 Student DijkstraPathRouter google tests have reasonable coverage
5 Google tests detect errors in instructor buggy code
5 BusSystemIndexer functions pass all tests
5 DijkstraPathRouter pass all student tests
5 DijkstraPathRouter pass all instructor tests
5 DijkstraTransportationPlanner pass all tests (except path description)
5 TransportationPlannerCommandLine pass all tests
5 transplanner fully functional (except print)
5 speedtest fully functional and performs at least at baseline speed
ECS34 WQ24 February 17, 2024
Project 4
8 of 9
10 Code is properly commented with consistent conventions
10 Documentation of classes is consistent and complete
10 Student understands all code they have provided
Extra Credit
There are two opportunities for extra credit on Project 4: Path Description and Speed Performance.
(Up to 25% extra) Path Description
Successfully implement the GetPathDescription function of the
CDijkstraTransportationPlanner class. Must pass all tests, and transplanner
must print the path as the provided version does for the same input.
(Up to 25% extra) Speed Performance
The speed test will test the speed of your CDijkstraTransportationPlanner against the
baseline code. The idea is that your program would be part of a server that would be rebooted daily
and then would handle as many queries as possible. The more queries your program can handle in
a day, the fewer servers that would need to be in operation to handle the daily load. Your program
will have a maximum of 30s to load the data and do any precomputation necessary to start handling
the requests.
A speedtest program has been provide for the baseline (speedtest_baseline) and the
optimized version (speedtest_optimized). The program will output the number of queries
that could be completed in 24hr, it will also output a brief of the path distances/times. A
speedtest.cpp source file that will calculate the number of queries has been provided. Do not
modify the speedtest.cpp when constructing your speedtest program. A verbose listing
of the paths can be created with the --verbose option. Speed comparisons will be done with
compiler optimizations disabled. If your implementation outperforms the baseline
speedtest_baseline, some extra credit will be available. The goal for full extra credit is to
outperform the speedtest_optimized.
Helpful Hints
• Read through the guides that are provided on Canvas
• See http://www.cplusplus.com/reference/, it is a good reference for C++ built in functions
and classes
• Use lenth(), substr(), etc. from the string class whenever possible.
• If the build fails, there will likely be errors, scroll back up to the first error and start from
there.
• You may find the following line helpful for debugging your code:
std::cout<<__FILE__<<" @ line: "<<__LINE__<
It will output the line string "FILE @ line: X" where FILE is the source filename and
X is the line number the code is on. You can copy and paste it in multiple places and it will
output that particular line number when it is on it.
ECS34 WQ24 February 17, 2024
Project 4
9 of 9
• Make sure to use a tab and not spaces with the Makefile commands for the target
• make will not warn about undefined variables by default, you may find the
--warn-undefined-variables option very helpful
• The debug option for make can clarify which targets need to be built, and which are not.
The basic debugging can be turned on with the --debug=b option. All debugging can be
turned on with the --debug=a option.
• Make sure to use a.gitignore file to ignore your object files, and output binaries.
• Do not wait to the end to merge with you partner. You should merge your work together
on a somewhat regular basis (or better yet pair program).
• Use CStringDataSource and CStringDataSink to test your reader and writer
classes for DSV and XML.
• You will probably want to use static functions in your classes for the callbacks to the library
calls that require callbacks. The call data (void *) parameter that the functions take and
the callbacks pass back as a parameter, should be this from your object.
• You may find https://www.xml.com/pub/1999/09/expat/index.html helpful for describing
the libexpat functions. You are not going to need to use every function in the Expat library.
• The OSM XML file format is described https://wiki.openstreetmap.org/wiki/OSM_XML.
Though not necessarily important for this project, the tag features are described are
https://wiki.openstreetmap.org/wiki/Map_features.
• Use the --gtest_output=xml:filename to create test results files that can be used
to prevent rerunning tests that have already succeeded.
• Use the --gtest_filter=-Test.Subtest1:Test.Subtest2 to skip google
tests that won’t pass. This can be helpful for skipping say the
CSVOSMTransporationPlanner.PathDescription test that is extra credit.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!