IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
FSThrusterCollection Class Reference

Public Member Functions

 FSThrusterCollection (vector< THRUSTER_HANDLE > thrusters, VESSEL *vessel)
 
 FSThrusterCollection (vector< FiringSolutionThruster > &thrusters)
 Constructs the collection out of already created FiringSolutionThrusters. Intended for use in unit tests. More...
 
vector< FiringSolutionThruster * > & GetThrustersInGroup (THGROUP_TYPE group)
 
vector< FiringSolutionThruster * > GetGroupUnion (vector< THGROUP_TYPE > &groups, THGROUP_TYPE governing_group)
 
map< FORCETYPE, VECTOR3 > GetTotalForces (THGROUP_TYPE group)
 Retrieves the overall forces all thrusters from this group will exert on the vessel. More...
 
vector< FiringSolutionThruster * > GetThrusters ()
 

Private Member Functions

void createGroupLists ()
 
void compareThrusterScores ()
 Compares the scores of the passed thrusters and decides if there are some group assignements that don't make sense. More...
 
void applyFinalScores ()
 Applies final scoring to thruster suitability by the amount of groups they are assigned to.
 
map< THGROUP_TYPE, double > getMaximumGroupScores ()
 
void calculateOverallForces ()
 

Private Attributes

vector< FiringSolutionThruster * > thrusterlist
 
map< THGROUP_TYPE, vector< FiringSolutionThruster * > > grouplists
 
map< THGROUP_TYPE, map< FORCETYPE, VECTOR3 > > totalforces
 
bool deletethrustersonexit = true
 

Static Private Attributes

static const double MINRELATIVEEFFICIENCY = 0.3
 

Detailed Description

This class represents the entire RCS with all involved thrusters of a vessel

Constructor & Destructor Documentation

FSThrusterCollection::FSThrusterCollection ( vector< FiringSolutionThruster > &  thrusters)

Constructs the collection out of already created FiringSolutionThrusters. Intended for use in unit tests.

Parameters
thrustersVector of already constructed thrusters.
Note
The lifetime of thrusters must be longer than the lifetime of the collection created with this constructor!

Member Function Documentation

void FSThrusterCollection::compareThrusterScores ( )
private

Compares the scores of the passed thrusters and decides if there are some group assignements that don't make sense.

A thruster will consider itself suitable to groups if it is equally useless in both of them and can't make out a clearly dominating purpose. Calling this method will enable the thruster to examine itself in the bigger context. It might be that it is in fact needed in some of those groups because there's noone better around for the job. But it's also possible that there are thrusters that can handle those groups a lot more efficiently, in which case the thruster will remove itself from these groups.

Parameters
thrustersA vector containing all thrusters to be compared, commonly all RCS thrusters on the vessel.
vector< FiringSolutionThruster * > FSThrusterCollection::GetGroupUnion ( vector< THGROUP_TYPE > &  groups,
THGROUP_TYPE  governing_group 
)
Returns
A vector containing all thrusters appearing in any of the demanded groups AND the governing group.

This method is a bit misnamed, but it's difficult to name. Basically what it does is give the intersection between the governing group and the union of the other groups. I.e. every thruster that is part of the governing group and also appears in any of the other groups.

Parameters
groupsA list of groups from which the union is constructed.
governing_groupThe result will be the intersection of this group and the union of groups. The resulting vector will also be sorted by the thrusters scoring in this group.
vector<FiringSolutionThruster*> FSThrusterCollection::GetThrusters ( )
inline
Returns
A reference to the entire thrusterlist
vector< FiringSolutionThruster * > & FSThrusterCollection::GetThrustersInGroup ( THGROUP_TYPE  group)
Returns
A reference to a vector of pointers to all thrusters in a group, sorted in descending order by their suitability for that score
Parameters
groupThe group to get the thrusters of.
map< FORCETYPE, VECTOR3 > FSThrusterCollection::GetTotalForces ( THGROUP_TYPE  group)

Retrieves the overall forces all thrusters from this group will exert on the vessel.

Parameters
groupThe thruster group for which to retrieve the forces
Returns
A map with the keys F_LINEAR and F_TORQUE, containing the corresponding force vectors

The documentation for this class was generated from the following files: