41 #ifndef REPAST_ERRORS_H
42 #define REPAST_ERRORS_H
48 #include <boost/lexical_cast.hpp>
53 std::string err_msg(
int idNum, std::string thrown_by, std::string reason, std::string explanation,
54 std::string cause, std::string resolution);
56 std::string err_msg_omit_rank(
int idNum, std::string thrown_by, std::string reason, std::string explanation,
57 std::string cause, std::string resolution);
60 std::string make_vec_str(
const std::vector<T>& v){
63 for(
size_t i = 0; i < v.size(); i++) ss << v[i] <<
", ";
69 std::string make_str(
const T t){
77 #define INVALID_ARG(_VAL) std::invalid_argument(err_msg(_VAL
78 #define INVALID_ARG_OMIT_RANK(_VAL) std::invalid_argument(err_msg_omit_rank(_VAL
79 #define DOMAIN_ERR(_VAL) std::domain_error(err_msg(_VAL
80 #define DOMAIN_ERR_OMIT_RANK(_VAL) std::domain_error(err_msg_omit_rank(_VAL
81 #define OUT_OF_RANGE(_VAL) std::out_of_range(err_msg(_VAL
83 #define THROWN_BY , std::string("") +
84 #define REASON , std::string("") +
85 #define EXPLANATION , std::string("") +
86 #define CAUSE , std::string("") +
87 #define RESOLUTION , std::string("") +
88 #define END_ERR )){}};
90 #define VAL(a) (boost::lexical_cast<std::string>(a))
96 class Repast_Error_1:
public std::domain_error{
98 Repast_Error_1(
int val): DOMAIN_ERR(ERROR_NUMBER 1)
99 THROWN_BY
"AgentImporter::decrementImportedAgentCount(int exportingRank)"
100 REASON
"'exportingRank' is invalid; value = '" + VAL(val) +
"'"
101 EXPLANATION
"The index listing ranks that are exporting their agents to this process does not contain an entry for the specified rank."
102 CAUSE
"An agent request cancellation may have been issued for an agent that was not being exported."
103 RESOLUTION
"Ensure that only agents that have been requested are canceled."
107 template <typename T>
108 class Repast_Error_2: public std::invalid_argument{
110 Repast_Error_2(T agId, std::string projName): INVALID_ARG(ERROR_NUMBER 2)
111 THROWN_BY
"BaseGrid::moveTo(AgentId&, vector<GPType> newLocation)"
112 REASON
"Agent '" + make_str(agId) +
"' is not in space '" + projName +
""
113 EXPLANATION
"The spatial projection that is attempting to move an agent does not contain the specified agent."
119 class Repast_Error_3: public std::invalid_argument{
121 Repast_Error_3(
int size,
int dims): INVALID_ARG(ERROR_NUMBER 3)
122 THROWN_BY
"BaseGrid::moveTo(AgentId&, vector<GPType> newLocation)"
123 REASON
"'newLocation' is invalid: has " + VAL(size) +
" dimensions, while space has " + VAL(dims)
124 EXPLANATION
"The spatial projection is attempting to move an agent to a destination, but the destination is not fully specified;" +
125 "it has fewer dimensions than the space does."
131 class Repast_Error_4: public std::invalid_argument{
133 Repast_Error_4(
int numAngles,
int dims): INVALID_ARG(ERROR_NUMBER 4)
134 THROWN_BY
"BaseGrid::moveByVector(const T* agent, double distance, const std::vector<double>& anglesInRadians)"
135 REASON
"'anglesInRadians' is invalid: has " + VAL(numAngles) +
" angles, while space has " + VAL(dims) +
" dimensions"
136 EXPLANATION
"To move by a vector, the number of angles in the vector passed must equal the number of dimensions in the space."
142 class Repast_Error_5: public std::invalid_argument{
144 Repast_Error_5(
int size,
int dims): INVALID_ARG(ERROR_NUMBER 5)
145 THROWN_BY
"BaseGrid::moveByDisplacement(const T* agent, const std::vector<GPType>& displacement)"
146 REASON
"Size of displacement vector = " + VAL(size) +
" but space has " + VAL(dims) +
" dimensions."
147 EXPLANATION
"The vector specifying displacement must have the same number of dimensions as the space."
153 template <typename T>
154 class Repast_Error_6: public std::invalid_argument{
156 Repast_Error_6(T
id, std::string spaceName): INVALID_ARG(ERROR_NUMBER 6)
157 THROWN_BY
"BaseGrid::moveByDisplacement(const T* agent, const std::vector<GPType>& displacement)"
158 REASON
"Agent " + make_str(id) +
" is not present in this space " + spaceName
159 EXPLANATION
"The specified agent is not present in the specified space"
160 CAUSE
"The agent has not yet been introduced into the space, or it has been removed."
161 RESOLUTION
"Confirm that the agent being moved should be in the specified space."
165 class Repast_Error_7: public std::invalid_argument{
167 Repast_Error_7(
int P1Dim,
int P2Dim): INVALID_ARG(ERROR_NUMBER 7)
168 THROWN_BY
"double BaseGrid::getDistanceSq(const Point<GPType>& pt1, const Point<GPType>& pt2)"
169 REASON
"Point P1 has " + VAL(P1Dim) +
" dimensions while P2 has " + VAL(P2Dim) +
" dimensions"
170 EXPLANATION
"Points for which distance is being calculated must have the same number of dimensions"
176 class Repast_Error_8: public std::invalid_argument{
178 Repast_Error_8(
int P1Dim,
int P2Dim): INVALID_ARG(ERROR_NUMBER 8)
179 THROWN_BY
"double BaseGrid::getDisplacement(const Point<GPType>& pt1, const Point<GPType>& pt2, " +
180 "std::vector<GPType>& out))"
181 REASON
"Point P1 has " + VAL(P1Dim) +
" dimensions while P2 has " + VAL(P2Dim) +
" dimensions"
182 EXPLANATION
"Points for which displacement is being calculated must have the same number of dimensions"
188 class Repast_Error_9: public std::invalid_argument{
190 Repast_Error_9(std::string projName): INVALID_ARG(ERROR_NUMBER 9)
191 THROWN_BY
"Context<T>::addProjection(Projection<T>* projection)"
192 REASON
"The context already contains a projection with the name '" + projName +
"'"
193 EXPLANATION
"Names of projections in contexts must be unique; two projections with the " +
194 "same name cannot be added, nor can the same projection be added twice."
196 RESOLUTION
"Ensure that projections are uniquely named and only added to the context once."
200 class Repast_Error_10: public std::invalid_argument{
202 Repast_Error_10(
int dims): INVALID_ARG(ERROR_NUMBER 10)
203 THROWN_BY
"Grid2DQuery<T>::Grid2DQuery(const Grid<T, int>* grid)"
204 REASON
"Grid2DQuery can only be used with 2 dimensions; grid has " + VAL(dims) +
" dimensions"
205 EXPLANATION
"The query constructor was passed a grid that has the wrong number of dimensions."
207 RESOLUTION
"Ensure that the grids being used with the Grid2DQuery are 2-D grids."
211 template <typename T>
212 class Repast_Error_11: public std::out_of_range{
214 Repast_Error_11(std::vector<int> pt, T dimensions): OUT_OF_RANGE(ERROR_NUMBER 11)
215 THROWN_BY
"void Borders::boundsCheck(const vector<int>& pt) const"
216 REASON
"The point passed (at " + make_vec_str(pt) +
" is outside the dimension range being checked (" + make_str(dimensions) +
")."
217 EXPLANATION
"The point passed to the boundary check is outside the permitted range; it probably " +
218 "falls outside the area of the simulation being managed by this process."
220 RESOLUTION
"Ensure that no agent is moving outside the boundaries of a process and its buffer zone."
224 template <typename T>
225 class Repast_Error_12: public std::out_of_range{
227 Repast_Error_12(std::vector<int> pt, T dimensions): OUT_OF_RANGE(ERROR_NUMBER 12)
228 THROWN_BY
"void Borders::boundsCheck(const vector<double>& pt) const"
229 REASON
"The point passed (at " + make_vec_str(pt) +
") is outside the dimension range being checked (" + make_str(dimensions) +
")."
230 EXPLANATION
"The point passed to the boundary check is outside the permitted range; it probably " +
231 "falls outside the area of the simulation being managed by this process."
233 RESOLUTION
"Ensure that no agent is moving outside the boundaries of a process and its buffer zone."
238 class Repast_Error_13: public std::invalid_argument{
240 Repast_Error_13(std::vector<double> oldPos, std::vector<double> newPos, std::vector<double> displacement): INVALID_ARG(ERROR_NUMBER 13)
241 THROWN_BY
"StrictBorders::translate(const std::vector<double>& oldPos, std::vector<double>& newPos, const std::vector<double>& displacement)"
242 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
243 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
244 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
245 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
252 class Repast_Error_14: public std::invalid_argument{
254 Repast_Error_14(std::vector<int> oldPos, std::vector<int> newPos, std::vector<int> displacement): INVALID_ARG(ERROR_NUMBER 14)
255 THROWN_BY
"StrictBorders::translate(const std::vector<int>& oldPos, std::vector<int>& newPos, const std::vector<int>& displacement)"
256 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
257 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
258 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
259 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
266 class Repast_Error_15: public std::invalid_argument{
268 Repast_Error_15(std::vector<double> oldPos, std::vector<double> newPos, std::vector<double> displacement): INVALID_ARG(ERROR_NUMBER 15)
269 THROWN_BY
"WrapAroundBorders::translate(const std::vector<double>& oldPos, std::vector<double>& newPos, const std::vector<double>& displacement)"
270 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
271 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
272 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
273 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
280 class Repast_Error_16: public std::invalid_argument{
282 Repast_Error_16(std::vector<int> oldPos, std::vector<int> newPos, std::vector<int> displacement): INVALID_ARG(ERROR_NUMBER 16)
283 THROWN_BY
"WrapAroundBorders::translate(const std::vector<int>& oldPos, std::vector<int>& newPos, const std::vector<int>& displacement)"
284 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
285 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
286 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
287 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
294 class Repast_Error_17: public std::invalid_argument{
296 Repast_Error_17(std::vector<double> oldPos, std::vector<double> newPos, std::vector<double> displacement): INVALID_ARG(ERROR_NUMBER 17)
297 THROWN_BY
"StickyBorders::translate(const std::vector<double>& oldPos, std::vector<double>& newPos, const std::vector<double>& displacement)"
298 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
299 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
300 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
301 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
308 class Repast_Error_18: public std::invalid_argument{
310 Repast_Error_18(std::vector<int> oldPos, std::vector<int> newPos, std::vector<int> displacement): INVALID_ARG(ERROR_NUMBER 18)
311 THROWN_BY
"StickyBorders::translate(const std::vector<int>& oldPos, std::vector<int>& newPos, const std::vector<int>& displacement)"
312 REASON
"The old position (" + make_vec_str(oldPos) +
"), new position (" + make_vec_str(newPos) +
") and " +
313 "displacement (" + make_vec_str(displacement) +
") must all have the same number of dimensions."
314 EXPLANATION
"Sizes of old position, new position, and displacement vectors do not match " +
315 "( " + VAL(oldPos.size()) +
" vs. " + VAL(newPos.size()) +
" vs. " + VAL(displacement.size()) +
" )."
322 class Repast_Error_19: public std::invalid_argument{
324 Repast_Error_19(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 19)
325 THROWN_BY
"createDblUni(string& name, vector<string>& params)"
326 REASON
"Creating double_uniform distribution '" + name +
"' requires the type of distributon " +
327 "plus two additional parameters (given " + make_vec_str(params) +
")"
328 EXPLANATION
"A value in the properties specifications requested the creation of a double_uniform distribution; " +
329 "this should have been in the form\n\n: distribution." + name +
" = double_uniform,FROM,TO\n\n" +
330 "where 'FROM' is the lower boundary for the distribution and 'TO' is the upper boundary. The error occurs "+
331 "because " + VAL(params.size()) +
" is too few or too many parameters."
332 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
333 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
338 class Repast_Error_20: public std::invalid_argument{
340 Repast_Error_20(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 20)
341 THROWN_BY
"createIntUni(string& name, vector<string>& params)"
342 REASON
"Creating int_uniform distribution '" + name +
"' requires the type of distributon " +
343 "plus two additional parameters (given " + make_vec_str(params) +
")"
344 EXPLANATION
"A value in the properties specifications requested the creation of an int_uniform distribution; " +
345 "this should have been in the form\n\n: distribution." + name +
" = int_uniform,FROM,TO\n\n" +
346 "where 'FROM' is the lower boundary for the distribution and 'TO' is the upper boundary. The error occurs "+
347 "because " + VAL(params.size()) +
" is too few or too many parameters."
348 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
349 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
354 class Repast_Error_21: public std::invalid_argument{
356 Repast_Error_21(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 21)
357 THROWN_BY
"createTriangle(string& name, vector<string>& params)"
358 REASON
"Creating triangle distribution '" + name +
"' requires the type of distributon " +
359 "plus three additional parameters (given " + make_vec_str(params) +
")"
360 EXPLANATION
"A value in the properties specifications requested the creation of a triangle distribution; " +
361 "this should have been in the form\n\n: distribution." + name +
" = int_uniform,LOWER,MOST_LIKELY,UPPER\n\n" +
362 "where 'LOWER' is the lower boundary for the distribution, 'MOST_LIKELY' is the most likely value, " +
363 "and 'UPPER' is the upper boundary. The error occurs "+
364 "because " + VAL(params.size()) +
" is too few or too many parameters."
365 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
366 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
371 class Repast_Error_22: public std::invalid_argument{
373 Repast_Error_22(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 22)
374 THROWN_BY
"createCauchy(string& name, vector<string>& params)"
375 REASON
"Creating Cauchy distribution '" + name +
"' requires the type of distributon " +
376 "plus two additional parameters (given " + make_vec_str(params) +
")"
377 EXPLANATION
"A value in the properties specifications requested the creation of a Cauchy distribution; " +
378 "this should have been in the form\n\n: distribution." + name +
" = cauchy,MEDIAN,SIGMA\n\n" +
379 "where 'MEDIAN' is the median value in the distribution and 'SIGMA' is the sigma" +
380 "parameter. The error occurs because " + VAL(params.size()) +
" is too few or too many parameters."
381 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
382 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
387 class Repast_Error_23: public std::invalid_argument{
389 Repast_Error_23(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 23)
390 THROWN_BY
"createExponential(string& name, vector<string>& params)"
391 REASON
"Creating Exponential distribution '" + name +
"' requires the type of distributon " +
392 "plus one additional parameter (given " + make_vec_str(params) +
")"
393 EXPLANATION
"A value in the properties specifications requested the creation of an exponential distribution; " +
394 "this should have been in the form\n\n: distribution." + name +
" = exponential,LAMBDA\n\n" +
395 "where 'LAMBDA' is the lambda parameter. The error occurs because " +
396 VAL(params.size()) +
" is too few or too many parameters."
397 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
398 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
403 class Repast_Error_24: public std::invalid_argument{
405 Repast_Error_24(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 24)
406 THROWN_BY
"createNormal(string& name, vector<string>& params)"
407 REASON
"Creating Normal distribution '" + name +
"' requires the type of distributon " +
408 "plus two additional parameters (given " + make_vec_str(params) +
")"
409 EXPLANATION
"A value in the properties specifications requested the creation of a normal distribution; " +
410 "this should have been in the form\n\n: distribution." + name +
" = normal,MEAN,SIGMA\n\n" +
411 "where 'MEAN' is the mean value and 'SIGMA' is the sigma parameter. The error occurs because " +
412 VAL(params.size()) +
" is too few or too many parameters."
413 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
414 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
419 class Repast_Error_25: public std::invalid_argument{
421 Repast_Error_25(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 25)
422 THROWN_BY
"createLogNormal(string& name, vector<string>& params)"
423 REASON
"Creating Log Normal distribution '" + name +
"' requires the type of distributon " +
424 "plus two additional parameters (given " + make_vec_str(params) +
")"
425 EXPLANATION
"A value in the properties specifications requested the creation of a log normal distribution; " +
426 "this should have been in the form\n\n: distribution." + name +
" = lognormal,MEAN,SIGMA\n\n" +
427 "where 'MEAN' is the mean value and 'SIGMA' is the sigma parameter. The error occurs because " +
428 VAL(params.size()) +
" is too few or too many parameters."
429 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
430 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
435 class Repast_Error_26: public std::invalid_argument{
437 Repast_Error_26(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 26)
438 THROWN_BY
"void initializeRandom(const Properties& props, boost::mpi::communicator* comm)"
439 REASON
"Creating a distribution requires at least a distribution name (given " + make_vec_str(params) +
")"
440 EXPLANATION
"A value in the properties specifications requested the creation of random distribution; " +
441 "this should have been in the form\n\n: distribution." + name +
" = TYPE,param1,param2\n\n" +
442 "where 'TYPE' is the type of distribution and param1, param2, etc. are the parameters needed " +
443 "to generate that distribution (if any). The error occurs because too few parameters are specified."
444 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
445 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
450 class Repast_Error_27: public std::invalid_argument{
452 Repast_Error_27(std::string name, std::vector<std::string> params): INVALID_ARG(ERROR_NUMBER 27)
453 THROWN_BY
"void initializeRandom(const Properties& props, boost::mpi::communicator* comm)"
454 REASON
"Creating a distribution requires the name of a known distribution (given " + make_vec_str(params) +
")"
455 EXPLANATION
"A value in the properties specifications requested the creation of random distribution; " +
456 "this should have been in the form\n\n: distribution." + name +
" = TYPE,param1,param2\n\n" +
457 "where 'TYPE' is the type of distribution and param1, param2, etc. are the parameters needed " +
458 "to generate that distribution (if any). The error occurs because the TYPE value is " +
459 "not a kind of distribution that is recognized."
460 CAUSE
"Generally this is a problem in the properties file or in the command line arguments."
461 RESOLUTION
"Alter the properties specification to provide the correct number of arguments."
467 class Repast_Error_28: public std::domain_error{
469 Repast_Error_28(): DOMAIN_ERR(ERROR_NUMBER 28)
470 THROWN_BY
"SVDataSet::record()"
471 REASON
"Attempted to record to a data set that is not open"
472 EXPLANATION
"Closed data sets cannot record"
473 CAUSE
"Usually this is an error in the scheduling of data collection."
474 RESOLUTION
"Ensure that no scheduled event calling 'record' occurs after the data set is closed."
479 class Repast_Error_29: public std::domain_error{
481 Repast_Error_29(): DOMAIN_ERR(ERROR_NUMBER 29)
482 THROWN_BY
"SVDataSet::write()"
483 REASON
"Attempted to write a data set that is not open"
484 EXPLANATION
"Closed data sets cannot write"
485 CAUSE
"Usually this is an error in the scheduling of data collection."
486 RESOLUTION
"Ensure that no scheduled event calling 'write' occurs after the data set is closed."
491 class Repast_Error_30: public std::invalid_argument{
493 Repast_Error_30(
int rank): INVALID_ARG(ERROR_NUMBER 30)
494 THROWN_BY
"SharedNetwork<V, E>::removeSender(int rank) "
495 REASON
"Sender being removed (" + VAL(rank) +
") is not in the list of senders."
496 EXPLANATION
"Repast HPC is attempting to decrement the count of agents being exported " +
497 "from each rank by the SharedNetwork, but the rank specified does not have" +
498 "any value associated with it (equivalent to the rank 'sending' zero agents" +
501 RESOLUTION
"Confirm that all network functions (including creation of links and moving agents) " +
502 "are being called only when agents are actually being added or removed from the " +
508 template <typename T>
509 class Repast_Error_31: public std::invalid_argument{
511 Repast_Error_31(T
id): INVALID_ARG(ERROR_NUMBER 31)
512 THROWN_BY
"SharedContext<T>::decrementProjRefCount(const AgentId& id)"
513 REASON
"Id '" + make_str(id) +
"' is not contained in the map of projections and references"
514 EXPLANATION
"An attempt was made to remove a non-local agent from a projection, but the agent " +
515 "was not present in the map of non-local agents and their projection reference counts."
516 CAUSE
"Possibly this reflects a borrowed agent being moved or cancelled more times than" +
518 RESOLUTION
"Ensure that each non-local agent is removed/cancelled only once."
523 template <typename T>
524 class Repast_Error_32: public std::domain_error{
526 Repast_Error_32(T
id): DOMAIN_ERR(ERROR_NUMBER 32)
527 THROWN_BY
"RepastProcess::syncAgentStatus(SharedContext<T>& context, Provider& provider, AgentCreator& creator)"
528 REASON
"The process has received information about an agent (" + make_str(id) +
") that does not exist on this process."
529 EXPLANATION
"A process has sent information to this process that could be used to update that agent's " +
530 "status, but the agent does not exist on this process."
531 CAUSE
"A problem with the balance of agent requests has occurred, or a non-local agent has been removed from " +
532 "this process without notifying the other processes that its information need no longer be sent."
533 RESOLUTION
"Ensure that all changes to borrowed agents are appropriate and reconciled with their home "
539 class Repast_Error_33: public std::domain_error{
541 Repast_Error_33(): DOMAIN_ERR(ERROR_NUMBER 33)
542 THROWN_BY
"SVDataSetBuilder& SVDataSetBuilder::addDataSource(SVDataSource* source)"
543 REASON
"Cannot call 'addDataSource' after Data Set Builder has been used to construct a dataset"
544 EXPLANATION
"The SVDataSetBuilder should be used to construct exactly on SVDataSet. The instance " +
545 "of SVDataSetBuilder should be used in a sequence: first the instance is created, then" +
546 "data sources are added (using addDataSource), then the data set is created (using " +
547 "'createDataSet'), containing all of the data sources added. This error is thrown when " +
548 "'addDataSource' is called after 'createDataSet' has already returned the Data Set being " +
550 CAUSE
"Generally this is a problem in model initialization or scheduling of initialization events."
551 RESOLUTION
"Ensure that the proper sequence of instructions is used to create the SVDataSet."
556 class Repast_Error_34: public std::domain_error{
558 Repast_Error_34(): DOMAIN_ERR(ERROR_NUMBER 34)
559 THROWN_BY
"SVDataSetBuilder::createDataSet()"
560 REASON
"This function is being called for a second time, but can only be called once."
561 EXPLANATION
"An instance of the SVDataSetBuilder class should be used exactly once, to create a " +
562 "single SVDataSet instance. This error occurs when the 'createDataSet' method is called " +
563 "for a second time on the same SVDataSetBuilder instance."
564 CAUSE
"Generally this is a problem in model initialization or scheduling of initialization events."
565 RESOLUTION
"Ensure that the proper sequence of instructions is used to create the SVDataSet."
570 template <typename T>
571 class Repast_Error_35: public std::invalid_argument{
573 Repast_Error_35(T pt1, T pt2): INVALID_ARG(ERROR_NUMBER 35)
574 THROWN_BY
"Point<T>::add(const Point<T> &pt)"
575 REASON
"The two points being added do not have the same number of dimensions " +
576 "(" + make_str(pt1) +
" vs. " + make_str(pt2) +
")"
577 EXPLANATION
"Point addition can only be done if the two points have the same number of dimensions."
579 RESOLUTION
"Ensure that all points use the same number of dimensions."
584 template <typename T>
585 class Repast_Error_36: public std::invalid_argument{
587 Repast_Error_36(T origin, T dimensions,
int originDimCount,
int dimensionsDimCount): INVALID_ARG(ERROR_NUMBER 36)
588 THROWN_BY
"GridDimensions::GridDimensions(Point<int> origin, Point<int> dimensions)"
589 REASON
"Number of dimensions in origin (" + make_str(origin) +
" = " + VAL(originDimCount) +
") " +
590 "does not equal number of dimensions in dimension specification (" + make_str(dimensions) +
" = " +
591 VAL(dimensionsDimCount) +
")"
592 EXPLANATION
"When creating a grid the number of dimensions used to specify the origin and the number of dimensions" +
593 "used to specify the extents must be commensurate."
594 CAUSE
"Improper model initialization"
595 RESOLUTION
"Reconcile the number of dimensions used."
599 class Repast_Error_37: public std::invalid_argument{
601 Repast_Error_37(
const std::vector<int> point,
int dimensionsDimCount): INVALID_ARG(ERROR_NUMBER 37)
602 THROWN_BY
"GridDimensions::contains(const std::vector<int>& pt)"
603 REASON
"Number of dimensions in point (" + make_vec_str(point) +
" = " + VAL(point.size()) +
") " +
604 "does not equal number of dimensions in the grid (" + VAL(dimensionsDimCount) +
")"
605 EXPLANATION
"The number of dimensions in the point to be found must be the same as the number " +
606 "of dimensions in the grid."
608 RESOLUTION
"Reconcile the number of dimensions used."
613 class Repast_Error_38: public std::invalid_argument{
615 Repast_Error_38(
const std::vector<double> point,
int dimensionsDimCount): INVALID_ARG(ERROR_NUMBER 38)
616 THROWN_BY
"GridDimensions::contains(const std::vector<double>& pt)"
617 REASON
"Number of dimensions in point (" + make_vec_str(point) +
" = " + VAL(point.size()) +
") " +
618 "does not equal number of dimensions in the grid (" + VAL(dimensionsDimCount) +
")"
619 EXPLANATION
"The number of dimensions in the point to be found must be the same as the number " +
620 "of dimensions in the grid."
622 RESOLUTION
"Reconcile the number of dimensions used."
627 class Repast_Error_39: public std::domain_error{
629 Repast_Error_39(): DOMAIN_ERR_OMIT_RANK(ERROR_NUMBER 39)
630 THROWN_BY
"RepastProcess* RepastProcess::instance()"
631 REASON
"RepastProcess must be initialized before calling instance"
632 EXPLANATION
"The instance of RepastProcess is not created until RepastProcess::init() is called"
633 CAUSE
"Improper model initialization"
634 RESOLUTION
"Call RepastProcess::init() before attempting to access the instance of RepastProcess"
639 template <typename T>
640 class Repast_Error_40: public std::domain_error{
642 Repast_Error_40(T
id,
int rank,
int dest1,
int dest2): DOMAIN_ERR(ERROR_NUMBER 40)
643 THROWN_BY
"RepastProcess::moveAgent(const AgentId& id, int process)"
644 REASON
"An attempt was made to move agent " + make_str(id) +
" to two different processes " +
645 "during a single iteration (from rank " + VAL(rank) +
" to " + VAL(dest2) +
" but already " +
646 "moved to " + VAL(dest1)
647 EXPLANATION
"An agent can be moved from one process to another, but not from one process to two other " +
648 "processes; this error occurs when such an attempt is made."
649 CAUSE
"Improper algorithm for agent movement."
650 RESOLUTION
"Ensure than an agent moves once, then cannot be moved again."
655 class Repast_Error_41: public std::invalid_argument{
657 Repast_Error_41(
int max,
int actual, std::string name): INVALID_ARG_OMIT_RANK(ERROR_NUMBER 41)
658 THROWN_BY
"ConfigLexer::ConfigLexer(const string& file_name, boost::mpi::communicator* comm, int maxConfigFileSize)"
659 REASON
"The properties file '" + name +
" has an actual file size of " + VAL(actual) +
660 ", which exceeds the size passed as a maximum (" + VAL(max) +
")"
661 EXPLANATION
"The implementation has chosen to provide a maximum file size for the properties file, which " +
662 "is used to facilitate the transfer of the file across processes; however, the actual size of " +
663 "the file is too large, meaning that the file could only be transferred incompletely. " +
664 "Note: the actual limit is max size provided - 1"
665 CAUSE
"The file size specified is too small, or the properties file too large."
666 RESOLUTION
"Provide a larger file size or shrink the properties file"
671 class Repast_Error_42: public std::invalid_argument{
673 Repast_Error_42(std::string configFileName): INVALID_ARG_OMIT_RANK(ERROR_NUMBER 42)
674 THROWN_BY
"ConfigLexer::ConfigLexer(const string& file_name, boost::mpi::communicator* comm, int maxConfigFileSize)"
675 REASON
"The file '" + configFileName +
"' was not found."
676 EXPLANATION
"The file to be used for configuring the logger was not found."
677 CAUSE
"The file name may have been specified incorrectly, or the file is not present."
678 RESOLUTION
"Ensure that the file name matches an existing configuration file."
683 class Repast_Error_43: public std::invalid_argument{
685 Repast_Error_43(std::string file_name): INVALID_ARG_OMIT_RANK(ERROR_NUMBER 43)
686 THROWN_BY
"ConfigLexer::ConfigLexer(const string& file_name, boost::mpi::communicator* comm, int maxConfigFileSize)"
687 REASON
"An unknown error occurred while reading the config file '" + file_name +
"'"
688 EXPLANATION
"The file could not be read."
694 class Repast_Error_44: public std::invalid_argument{
696 Repast_Error_44(std::string val): INVALID_ARG(ERROR_NUMBER 44)
697 THROWN_BY
"strToUInt(const string& val)"
698 REASON
"String '" + val +
"' cannot be converted to unsigned int"
699 EXPLANATION
"The value represented by the string cannot be converted to an unsigned integer."
700 CAUSE
"Generally this is caused by improper values in properties files or command-line properties."
701 RESOLUTION
"Revise the string value to represent a valid unsigned int"
706 class Repast_Error_45: public std::invalid_argument{
708 Repast_Error_45(std::string val): INVALID_ARG(ERROR_NUMBER 45)
709 THROWN_BY
"strToInt(const string& val)"
710 REASON
"String '" + val +
"' cannot be converted to int"
711 EXPLANATION
"The value represented by the string cannot be converted to an integer."
712 CAUSE
"Generally this is caused by improper values in properties files or command-line properties."
713 RESOLUTION
"Revise the string value to represent a valid int"
718 class Repast_Error_46: public std::invalid_argument{
720 Repast_Error_46(std::string val): INVALID_ARG(ERROR_NUMBER 46)
721 THROWN_BY
"strToDoublet(const string& val)"
722 REASON
"String '" + val +
"' cannot be converted to double"
723 EXPLANATION
"The value represented by the string cannot be converted to a double."
724 CAUSE
"Generally this is caused by improper values in properties files or command-line properties."
725 RESOLUTION
"Revise the string value to represent a valid double"
731 template <typename T>
732 class Repast_Error_47: public std::out_of_range{
734 Repast_Error_47(
int matrixDimensions,
int pointDimensions, T index): OUT_OF_RANGE(ERROR_NUMBER 47)
735 THROWN_BY
"Matrix<T>::boundsCheck(const Point<int>& index)"
736 REASON
"Number of dimensions in index point (" + make_str(index) +
" = " + VAL(pointDimensions) +
") does not equal matrix dimensions (" + std::to_string(matrixDimensions) +
")"
737 EXPLANATION
"The dimensions of the index point must match those of the matrix to check boundaries"
744 template <typename T>
745 class Repast_Error_48: public std::out_of_range{
747 Repast_Error_48(
int dimensionIndex,
int pointValue, T index,
int size): OUT_OF_RANGE(ERROR_NUMBER 48)
748 THROWN_BY
"Matrix<T>::boundsCheck(const Point<int>& index)"
749 REASON
"Value of coordinate " + VAL(dimensionIndex) +
" in point " + make_str(index) +
" is " + VAL(pointValue) +
" which is outside range 0 - " + VAL(size)
750 EXPLANATION
"The point must specify a valid entry in the matrix; the values that make up the point must " +
751 "be greater than zero and less than the size of the matrix on the given dimension"
758 template <typename T>
759 class Repast_Error_49: public std::invalid_argument{
761 Repast_Error_49(
size_t dims, T gridDimensions): INVALID_ARG(ERROR_NUMBER 49)
762 THROWN_BY
"SharedBaseGrid<T, GPTransformer, Adder, GPType>::SharedBaseGrid(std::string name, " +
763 "GridDimensions gridDims, std::vector<int> processDims, int buffer, boost::mpi::communicator* comm)"
764 REASON
"Invalid number of grid dimensions (" + VAL (dims) +
"): " + make_str(gridDimensions)
765 EXPLANATION
"SharedBaseGrid can only use 1- or 2-dimensional grids"
766 CAUSE
"Improper model construction"
767 RESOLUTION
"Modify the grid to be only 1 or 2 dimensions"
772 template <typename T>
773 class Repast_Error_50: public std::invalid_argument{
775 Repast_Error_50(
size_t dims, T gridDimensions,
int processDims): INVALID_ARG(ERROR_NUMBER 50)
776 THROWN_BY
"SharedBaseGrid<T, GPTransformer, Adder, GPType>::SharedBaseGrid(std::string name, " +
777 "GridDimensions gridDims, std::vector<int> processDims, int buffer, boost::mpi::communicator* comm)"
778 REASON
"Invalid number of grid dimensions (" + VAL (dims) +
"): " + make_str(gridDimensions) +
" "
779 "Does not match number of process dimensions (" + VAL(processDims) +
")"
780 EXPLANATION
"SharedBaseGrid dimensions must match number of process dimensions"
781 CAUSE
"Improper model construction, or improper process topology"
782 RESOLUTION
"Modify the grid or the process toplogy to match"
787 class Repast_Error_51: public std::invalid_argument{
789 Repast_Error_51(
int dimCount,
int extent,
double pCount): INVALID_ARG(ERROR_NUMBER 51)
790 THROWN_BY
"SharedBaseGrid<T, GPTransformer, Adder, GPType>::SharedBaseGrid(std::string name, " +
791 "GridDimensions gridDims, std::vector<int> processDims, int buffer, boost::mpi::communicator* comm)"
792 REASON
"Number of processes in a given dimension must divide evenly into the extent of that dimension; " +
793 "In dimension " + VAL(dimCount) +
" the extent is " + VAL(extent) +
" but the process count is " + VAL(pCount)
794 EXPLANATION
"Repast HPC will try to apportion the total simulation grid among some set of processes; to " +
795 "achieve this, the grid dimensions of the space must divide evenly among the processes. So, if " +
796 "the total space is 900 in the x dimension and 900 in the y dimension, and there are 9 processes " +
797 "in a 3 x 3 grid, this will work, with 300 x 300 on each process. However, if the space is 1000 x 1000 " +
798 " a 3 x 3 grid cannot be used."
799 CAUSE
"The extent of space and the number of processes in the x and y directions, as specified " +
800 "in the properties file, are not compatible."
801 RESOLUTION
"Modify the model parameters to make the space evenly divisible by the processes in each "
808 class Repast_Error_52: public std::invalid_argument{
810 Repast_Error_52(
int maxFileSize,
int actualSize, std::string name): INVALID_ARG(ERROR_NUMBER 52)
811 THROWN_BY
"Properties::readFile(const std::string& file, boost::mpi::communicator* comm, int maxPropFileSize)"
812 REASON
"Actual file size (" + VAL(actualSize) +
") exceeds specified maximum file size (" + VAL(maxFileSize) +
" for Properties file '" + name +
"'"
813 EXPLANATION
"A maximum expected file size can be specified to make the sharing of the properties file " +
814 "among processes more efficient; an error is thrown if the actual file size exceeds this " +
815 "value. Note: Actual limit is max size - 2"
816 CAUSE
"The actual properties file size is larger than the specified expected maximum"
817 RESOLUTION
"Reduce the size of the properties file or specify a larger maximum"
823 class Repast_Error_53: public std::invalid_argument{
825 Repast_Error_53(std::string fileName): INVALID_ARG(ERROR_NUMBER 53)
826 THROWN_BY
"Properties::readFile(const std::string& file, boost::mpi::communicator* comm, int maxPropFileSize)"
827 REASON
"Properties file '" + fileName +
"' not found."
828 EXPLANATION
"The file specified as the properties file is not present"
829 CAUSE
"The path or name of the file may be incorrect, or the file may be missing"
830 RESOLUTION
"Specify the name of an existing file"
835 class Repast_Error_54: public std::invalid_argument{
837 Repast_Error_54(
const std::string line,
const std::string file): INVALID_ARG(ERROR_NUMBER 54)
838 THROWN_BY
"Properties::readFile(const std::string& file, boost::mpi::communicator* comm, int maxPropFileSize)"
839 REASON
"Line '" + line +
"' in Properties file '" + file +
"' does not include '='"
840 EXPLANATION
"Properties must be specified in 'KEY = value' (or 'KEY=value') format"
841 CAUSE
"Properties file contains improperly formatted line."
842 RESOLUTION
"Modify the incorrect line in the properties file."
847 class Repast_Error_55: public std::invalid_argument{
849 Repast_Error_55(
const std::string line,
const std::string file): INVALID_ARG(ERROR_NUMBER 55)
850 THROWN_BY
"Properties::readFile(const std::string& file, boost::mpi::communicator* comm, int maxPropFileSize)"
851 REASON
"Line '" + line +
"' in Properties file '" + file +
"' does not include a key before the '='"
852 EXPLANATION
"Properties must be specified in 'KEY = value' (or 'KEY=value') format" +
853 "both key and value are required."
854 CAUSE
"Properties file contains improperly formatted line"
855 RESOLUTION
"Modify the incorrect line in the properties file."
860 class Repast_Error_56: public std::invalid_argument{
862 Repast_Error_56(
const std::string line,
const std::string file): INVALID_ARG(ERROR_NUMBER 56)
863 THROWN_BY
"Properties::readFile(const std::string& file, boost::mpi::communicator* comm, int maxPropFileSize)"
864 REASON
"Line '" + line +
"' in Properties file '" + file +
"' does not include a value after the '='"
865 EXPLANATION
"Properties must be specified in 'KEY = value' (or 'KEY=value') format; " +
866 "both key and value are required."
867 CAUSE
"Properties file contains improperly formatted line"
868 RESOLUTION
"Modify the incorrect line in the properties file."
872 class Repast_Error_57: public std::invalid_argument{
874 Repast_Error_57(): INVALID_ARG(ERROR_NUMBER 57)
875 THROWN_BY
"initializeSeed(Properties& props, boost::mpi::communicator* comm)"
876 REASON
"No communicator provided for use with global 'AUTO' seed."
877 EXPLANATION
"'AUTO' specified for global.random.seed, but initializeSeed(Properties&, boost::mpi::communicator* = 0) is called with no communicator pointer. Automatically generated random seed (from process 0) cannot be shared to all processes."
878 CAUSE
"Properties file cannot use AUTO for global.random.seed with this code"
879 RESOLUTION
"Modify the incorrect line in the properties file, or alter the code to provide a communicator for initializeSeed"