8 #ifndef CscKnowledgeItemTargetMemberToState_H_
9 #define CscKnowledgeItemTargetMemberToState_H_
20 CscKnowledgeItemTargetMemberToState(
int knoItemIdIn,
string knoItemNameIn,
const vector<const TargetMemberValues *> *inputsTargetValuesIn,
const vector<const TargetMemberPonderation *> *inputsTargetPercentsIn, map<string, float> *outputsCanMoveValues,
CscUnitType unitTypeIn,
string targetOriginMember,
bool symemtrySearch,
int nbStateMax,
const map<int, float> &maxDeltaPivotByPivotId,
bool optionCutLastestIfTheSameAndWorst,
bool optionCutBeginingIfTheSame,
bool optionDeltaPerStateMaxDegressive,
float percentAvg,
float percentMax,
float percentExtrapolation,
int stateDuration,
int stateDelay,
float solvedAt,
float processedAt,
bool outputTypes[],
CscArtificialIntelligenceTypes aiTypes, map<int, CscPoint3d*> centerOfMassOfAllMemberByMemberId);
22 void sequencePostTraitment(
CscSequence *sequenceIn)
override;
23 int getSequenceCountAutorized(
float initStateValue)
override;
24 float getExtrapolationResult(
CscSequence *sequenceIn)
override;
43 int getActionmaxJointDelta(
float initStateValue);
48 vector<string> targetMemberNames,
49 vector<string> relativeToMemberNames,
50 vector<float> posX, vector<float> posY, vector<float> posZ,
51 vector<float> posPondX, vector<float> posPondY, vector<float> posPondZ,
52 vector<float> pitch, vector<float> yaw, vector<float> roll,
53 vector<float> pitchPond, vector<float> yawPond, vector<float> rollPond,
54 vector<float> accX, vector<float> accY, vector<float> accZ,
55 vector<float> accPondX, vector<float> accPondY, vector<float> accPondZ,
56 vector<string> outputsCanMoveNames, vector<float> outputsCanMovePonderations,
59 int nbStateMax,
const map<int, float> &maxDeltaPivotByPivotId,
60 bool optionCutLastestIfTheSameAndWorst,
61 bool optionCutBeginingIfTheSame,
62 bool optionDeltaPerStateMaxDegressive,
65 float percentExtrapolation,
72 map<int, CscPoint3d*> centerOfMassOfAllMemberByMemberId) {
74 vector<const TargetMemberValues *> *targetMembersValues =
new vector<const TargetMemberValues *>();
75 vector<const TargetMemberPonderation *> *inputsTargetPercents =
new vector<const TargetMemberPonderation *>();
78 for (
int i = 0;
i < targetMemberNames.size();
i++) {
81 map<CscInputType, float> inputsTargetValuesCore;
82 inputsTargetValuesCore[
POS_X] = posX.at(
i);
83 inputsTargetValuesCore[
POS_Y] = posY.at(
i);
84 inputsTargetValuesCore[
POS_Z] = posZ.at(
i);
85 inputsTargetValuesCore[
PITCH] = pitch.at(
i);
86 inputsTargetValuesCore[
YAW] = yaw.at(
i);
87 inputsTargetValuesCore[
ROLL] = roll.at(
i);
88 inputsTargetValuesCore[
ACC_X] = accX.at(
i);
89 inputsTargetValuesCore[
ACC_Y] = accY.at(
i);
90 inputsTargetValuesCore[
ACC_Z] = accZ.at(
i);
91 inputsFinalCore->
values = inputsTargetValuesCore;
94 targetMembersValues->push_back(targetMemberVal);
98 for (
int i = 0;
i < targetMemberNames.size();
i++) {
101 map<CscInputType, float> inputsTargetPercentsCore;
102 inputsTargetPercentsCore[
POS_X] = posPondX.at(
i);
103 inputsTargetPercentsCore[
POS_Y] = posPondY.at(
i);
104 inputsTargetPercentsCore[
POS_Z] = posPondZ.at(
i);
105 inputsTargetPercentsCore[
PITCH] = pitchPond.at(
i);
106 inputsTargetPercentsCore[
YAW] = yawPond.at(
i);
107 inputsTargetPercentsCore[
ROLL] = rollPond.at(
i);
108 inputsTargetPercentsCore[
ACC_X] = accPondX.at(
i);
109 inputsTargetPercentsCore[
ACC_Y] = accPondY.at(
i);
110 inputsTargetPercentsCore[
ACC_Z] = accPondZ.at(
i);
111 percentsFInalCore->
values = inputsTargetPercentsCore;
112 targetMemberPonderation->
memberValues = percentsFInalCore;
114 inputsTargetPercents->push_back(targetMemberPonderation);
118 map<string, float> *outputsCanMoveValues =
new map<string, float>;
119 for (
int i = 0;
i < outputsCanMoveNames.size();
i++) {
120 if (outputsCanMovePonderations.at(
i) > 0.0f) {
121 string name = outputsCanMoveNames.at(
i);
122 float ponderation = outputsCanMovePonderations.at(
i);
123 outputsCanMoveValues->insert({name, ponderation});
127 return new CscKnowledgeItemTargetMemberToState(targetId, targetName, targetMembersValues, inputsTargetPercents, outputsCanMoveValues, unitType, targetOriginMember, symemtrySearch, nbStateMax, maxDeltaPivotByPivotId, optionCutLastestIfTheSameAndWorst, optionCutBeginingIfTheSame, optionDeltaPerStateMaxDegressive, percentAvg, percentMax, percentExtrapolation, stateDuration, stateDelay, solvedAt, processedAt, outputTypes, aiTypes, centerOfMassOfAllMemberByMemberId);
135 int findBestStateIndex(
CscSequence *parentSequence);
146 loweringPelvis(loweringPelvis),
147 footElevation(footElevation),
148 lateralMove(lateralMove),
150 objectiveValue(0.0
f) {
157 map<int, CscPoint3d*> centerOfMassOfAllMemberByMemberId;
164 map<int, float> lotteryWheelCreation(
CscGeneration *previousGeneration);
181 CscSequence *drawLotteryWheel(
CscGeneration *previousGeneration, map<int, float> lotteryWheel,
float totalScoreGeneration,
int previousGenerationSize, vector<CscPerson *> *parents);
190 CscSequence *drawOneParentLotteryWheel(
CscGeneration *previousGeneration, vector<CscPerson *> *parents, map<int, float> lotteryWheel);
209 CscSequence *selectOneParentByTournament(
CscState *initialState,
CscGeneration *previousGeneration,
unsigned nbParticipants,
float probaForBest, vector<CscPerson *> *parents,
const CscEntityModel *entityModel, optional<int> nbStateAdded = {});
256 float randomInterpolationValue(
float previousValue,
float nextValue,
float minValue,
float maxValue);
282 bool findBestParent(vector<CscPerson *> *parents);
310 int findIdOfStateBeforeFirstDropObjectiveValue(
CscSequence *sequence,
float dropTolerance);
337 void modifyIKTargetWithRegression(optional<vector<vector<CscJacobianInverseKinematic::TargetIKParams*>>> targetsInverseKinematic,
const vector<vector<float>> &data);