Body-building running scheme generation method based on ant colony optimization algorithm

文档序号:1659560 发布日期:2019-12-27 浏览:22次 中文

阅读说明:本技术 基于蚁群优化算法的健身跑运动方案生成方法 (Body-building running scheme generation method based on ant colony optimization algorithm ) 是由 游琪妍 蔡云鹏 倪友聪 张韬磊 陈硕 杜欣 于 2019-09-19 设计创作,主要内容包括:本发明涉及一种基于蚁群优化算法的健身跑运动方案生成方法,包括以下步骤:1、确定蚁群优化算法中各参数,并对各变量进行初始化;2、随机产生k个解,得到初始解记忆表;3、计算解记忆表中各解的适应度值,并按适应度值进行排序;4、当演化代数不大于最大演化代数时,转步骤5,否则转步骤8;5、计算每个解的权重,并采用轮盘赌抽样获取m个基准解;6、采用更新策略对获取的每个基准解进行更新;7、删除解记忆表中最差的m个解,并按适应度从小到大对余下的最好的k个解进行排序;然后取下一代演化代数,返回步骤4继续迭代;8、将解记忆表中排名第一的解作为最优解输出。该方法有利于生成安全、有效和个性化的健身跑运动方案。(The invention relates to a body-building running scheme generation method based on an ant colony optimization algorithm, which comprises the following steps of: 1. determining each parameter in the ant colony optimization algorithm, and initializing each variable; 2. randomly generating k solutions to obtain an initial solution memory table; 3. calculating the fitness value of each solution in the solution memory table, and sequencing according to the fitness value; 4. when the evolution algebra is not larger than the maximum evolution algebra, turning to the step 5, otherwise, turning to the step 8; 5. calculating the weight of each solution, and sampling by adopting roulette to obtain m reference solutions; 6. updating each obtained reference solution by adopting an updating strategy; 7. deleting the worst m solutions in the solution memory table, and sequencing the rest best k solutions according to the fitness from small to large; then, taking the next generation evolution algebra, and returning to the step 4 to continue iteration; 8. and outputting the first ranked solution in the solution memory table as the optimal solution. The method facilitates the generation of a safe, effective and personalized fitness running exercise program.)

1. A body-building running motion scheme generation method based on an ant colony optimization algorithm is characterized in that a motion scheme solution space omega is defined as a time sequence shown in a formula (1):

Ω={X|X=<(V(1),A(1)),...,(V(t),A(t)),...,(V(l),A(l))>} (1)

wherein V (t) and A (t) respectively represent the speed and gradient of the t-th period, l is the total number of periods, and the speed value is within the interval Vmin,Vmax]Taking, belonging to continuous variablesThe value of the gradient is from the set { A }1,A2,...,AnFetching the same, belonging to discrete variables;

defining the safe effective heart rate interval of the fitness run as formula (2):

safe and effective heart rate interval ═ 0.64HRmax,0.74HRmax] (2)

In the formula, HRmaxAt maximum heart rate, and HRmax220-age;

in solution X, the number of times the heart rate falls within the non-safe significant heart rate interval is defined as a function f (X) shown in equation (3):

in the formula (I), the compound is shown in the specification,the predicted heart rate of the time t period is calculated by the body-building running model;

the fitness running motion scheme generation is described as a constrained hybrid coding optimization problem: searching for an optimal solution X satisfying formula (4) under the condition of satisfying formula (2):

then the body-building running exercise scheme is generated according to the following steps:

(1) determining maximum evolution algebra g of ant colony optimization algorithmmaxThe number k of initial solutions, the number m of new solutions generated in each generation, the pheromone persistence epsilon, the coefficient q of the adjusting weight and the maximum heart rate HRmaxInitializing each variable, and assigning a current evolution algebra g as 1;

(2) randomly generating k solutions in a speed interval and a gradient set to obtain an initial solution memory table, wherein each solution in the solution memory table consists of r continuous variables and d discrete variables;

(3) calculating the fitness value of each solution in the solution memory table, and sequencing the solutions from small to large according to the fitness values;

(4) if the current evolution algebra g is not more than the maximum evolution algebra gmaxIf so, turning to the step (5), otherwise, turning to the step (8);

(5) calculate the weight ω (X) of each solutioni) And obtaining m reference solutions X by using roulette samplingi,1≤i≤m;

(6) For each obtained reference solution XaAnd a is less than or equal to m, the following operations are carried out: updating strategy ACO with continuous variablesMV-VTo the benchmark solution XaEach continuous variable V (t) is updated to obtain a new solution X'aThen adopting a discrete variable updating strategy ACOMV-ATo newly dissolve X'aEach discrete variable A (t) in the solution is updated to obtain a new solution X "aThen evaluating the solution X "aTo obtain a fitness value F (X) "a) And is prepared by reacting X "aAs Xk+aStoring in a solution memory table; until all the reference solutions are finished;

(7) deleting the worst m solutions in the solution memory table, and sequencing the rest best k solutions according to the fitness from small to large; then adding 1 to the current evolution algebra g, and returning to the step (4);

(8) and outputting the first ranked solution in the solution memory table as the optimal solution X.

2. The method of claim 1, wherein the solution memory table comprises k complete solutions { X [ ]1,X2,...,XkAccording to a method for generating a new solution from the solution memory table, sequentially updating continuous variables and then sequentially updating discrete variables; each solution consists of r continuous variables and d discrete variables, where r ═ d ═ l, and l denotes the total number of epochs; the solution memory table is dynamically updated as new solutions are generated.

3. The method for generating a running exercise scheme based on ant colony optimization algorithm according to claim 2, wherein the running exercise scheme generates an optimization target that the value of the objective function f is minimized, and the fitness is defined as formula (5):

F(Xi)=Rf+RD (5)

the above formula combines the objective function of formula (3) and the penalty functions of constraint violation degrees of formulas (6) and (7), and introduces a comprehensive ranking mechanism; rf、RDRespectively representing the punishment functions of the object function and the constraint violation degree to be ranked from small to large; the fitness satisfies: 1)falls within the interval [0.64HRmax,0.74HRmax]The fewer the number of times, the better; 2)the closer to the interval boundary, the better the fitness value is; 3) from the viewpoint of safety,fitness less than lower bound is better thanA fitness value greater than an upper boundary;

4. the method of claim 3, wherein the fitness running movement plan is generated according to fitness F (X)i) The solutions in the memory table are sorted from small to large to obtain the ranking of each solution and is marked as rank (X)i) Then calculate the solution XiWeight ω (X) ofi);ω(Xi) Is about ranking rank (X)i) Is defined as the formula(8):

Wherein q is a coefficient for adjusting the weight; after the weight is obtained, sampling by adopting a roulette method according to the probability defined by the formula (9) to obtain m reference solutions; ranking rank (X)i) The more advanced solution is, the higher the weight is, and the higher the probability of being extracted as the reference solution is;

5. the ant colony optimization algorithm-based body-building running exercise scheme generation method of claim 4, wherein the continuous variable update strategy ACOMV-VComprises the following steps: at the base solution XiIn, for each bit continuous variable Vi j(t), where j is not less than 1 and not more than r, in Vi j(t) updating the neighborhood by adopting a Gaussian probability density function with the mean value of mu and the standard deviation of sigma to obtain a new speedIt is defined as formula (10):

wherein the mean value isStandard deviation ofThe j-th continuous variable value of all solutions in the memory table is jointly determined, and the formula is defined as formula (11) and formula (12):

the above formula combines each solution X for each continuous variableiDetermining standard deviation according to the fitness of the target; because the data is Gaussian probability distribution, the large data distribution of the standard deviation is more dispersed, and the small data distribution of the standard deviation is more concentrated; according to the fitness to data scaling, the disturbance of a poor solution to the good solution is reduced, and the standard deviation of the poor solution is increased, so that the poor solution can generate a better solution more probably;

finally, if the code is illegal in the updating process, the generated new speed value is not in the speed interval [ V ] with the possibility of taking awaymin,Vmax]When the new solution is less than the minimum velocity VminThen with VminTaking a symmetry point for the symmetry axis, when the new solution is greater than the maximum velocity VmaxThen with VmaxThe symmetry points are taken for the symmetry axes until a new solution is obtained.

6. The ant colony optimization algorithm-based body-building running exercise scheme generation method of claim 5, wherein the discrete variable update strategy ACOMV-AComprises the following steps: at the base solution XiIn, for each bit discrete variable Ai j(t), wherein j is more than or equal to 1 and less than or equal to d, and the updating is carried out by adopting a continuous relaxation method, and the method comprises the following steps: directly processing the discrete variable as a continuous value in the same process as the updating strategy of the continuous variable, comparing the result obtained by updating with the discrete points in the selectable set, and taking the discrete point closest to the continuous value as the updated discrete point

Technical Field

The invention relates to the technical field of fitness running motion scheme generation, in particular to a fitness running motion scheme generation method based on an ant colony optimization algorithm.

Background

Exercising on an indoor treadmill is not affected by seasonal weather and is simple and efficient, and has become an important fitness mode. Most of the running machines on the market currently provide some optional exercise schemes constructed by applying domain knowledge to provide certain guidance for an exerciser in exercising and building up body. But still lack the personalized exercise and fitness guidance scheme which fully considers the physical function characteristics of the sporter. How to effectively improve the effect of the exerciser in exercising on the running machine on the premise of ensuring the safety of exercise has become an important research topic.

Disclosure of Invention

The invention aims to provide a body-building running scheme generation method based on an ant colony optimization algorithm, which is beneficial to generating a safe, effective and personalized body-building running scheme.

In order to achieve the purpose, the technical scheme of the invention is as follows: a body-building running motion scheme generation method based on an ant colony optimization algorithm defines a time sequence of a motion scheme solution space omega as shown in a formula (1):

Ω={X|X=<(V(1),A(1)),...,(V(t),A(t)),...,(V(l),A(l))>} (1)

wherein V (t) and A (t) respectively represent the speed and gradient of the t-th period, l is the total number of periods, and the speed value is within the interval Vmin,Vmax]Taking, from the set { A ], values belonging to continuous variables, of gradient1,A2,...,AnFetching the same, belonging to discrete variables;

defining the safe effective heart rate interval of the fitness run as formula (2):

safe and effective heart rate interval ═ 0.64HRmax,0.74HRmax] (2)

In the formula, HRmaxAt maximum heart rate, and HRmax220-age;

in solution X, the number of times the heart rate falls within the non-safe significant heart rate interval is defined as a function f (X) shown in equation (3):

in the formula (I), the compound is shown in the specification,the predicted heart rate of the time t period is calculated by the body-building running model;

the fitness running motion scheme generation is described as a constrained hybrid coding optimization problem: searching for an optimal solution X satisfying formula (4) under the condition of satisfying formula (2):

then the body-building running exercise scheme is generated according to the following steps:

(1) determining maximum evolution algebra g of ant colony optimization algorithmmaxThe number k of initial solutions, the number m of new solutions generated in each generation, the pheromone persistence epsilon, the coefficient q of the adjusting weight and the maximum heart rate HRmaxInitializing each variable, and assigning a current evolution algebra g as 1;

(2) randomly generating k solutions in a speed interval and a gradient set to obtain an initial solution memory table, wherein each solution in the solution memory table consists of r continuous variables and d discrete variables;

(3) calculating the fitness value of each solution in the solution memory table, and sequencing the solutions from small to large according to the fitness values;

(4) if the current evolution algebra g is not larger than the maximum evolution algebra, turning to the step (5), otherwise, turning to the step (8);

(5) calculate the weight ω (X) of each solutioni) And is combined withObtaining m reference solutions X by using roulette samplingi,1≤i≤m;

(6) For each obtained reference solution XaAnd a is less than or equal to m, the following operations are carried out: updating strategy ACO with continuous variablesMV-VTo the benchmark solution XaEach continuous variable V (t) is updated to obtain a new solution X'aThen adopting a discrete variable updating strategy ACOMV-ATo newly dissolve X'aEach discrete variable A (t) in the solution is updated to obtain a new solution X "aThen evaluating the solution X "aTo obtain a fitness value F (X) "a) And is prepared by reacting X "aAs Xk+aStoring in a solution memory table; until all the reference solutions are finished;

(7) deleting the worst m solutions in the solution memory table, and sequencing the rest best k solutions according to the fitness from small to large; then, adding 1 to the current evolution algebra g, and returning to the step (4);

(8) and outputting the first ranked solution in the solution memory table as the optimal solution X.

Further, the solution memory table contains k complete solutions { X }1,X2,...,XkAccording to a method for generating a new solution from the solution memory table, sequentially updating continuous variables and then sequentially updating discrete variables; each solution consists of r continuous variables and d discrete variables, where r ═ d ═ l, and l denotes the total number of epochs; the solution memory table is dynamically updated as new solutions are generated.

Further, the optimization goal generated by the body-building running scheme is to minimize the value of the objective function f, and the fitness is defined as formula (5):

F(Xi)=Rf+RD (5)

the above formula combines the objective function of formula (3) and the constraint violation degree penalty functions of formulas (6) and (7), and introduces a comprehensive ranking mechanism; rf、RDRespectively representing the punishment functions of the object function and the constraint violation degree to be ranked from small to large; the fitness satisfies: 1)falls within the interval [0.64HRmax,0.74HRmax]The fewer the number of times, the better; 2)the closer to the interval boundary, the better the fitness value is; 3)fitness less than lower bound is better thanA fitness value greater than an upper boundary;

further, according to the fitness F (X)i) The solutions in the memory table are sorted from small to large to obtain the ranking of each solution and is marked as rank (X)i) Then calculate the solution XiWeight ω (X) ofi);ω(Xi) Is about ranking rank (X)i) Is defined by the formula (8):

wherein q is a coefficient for adjusting the weight; after the weight is obtained, sampling by adopting a roulette method according to the probability defined by the formula (9) to obtain m reference solutions; ranking rank (X)i) The more advanced solution is, the higher the weight is, and the higher the probability of being extracted as the reference solution is;

further, the continuous variable update policy ACOMV-VComprises the following steps: at the base solution XiIn, for each bit continuous variable Vi j(t), where j is not less than 1 and not more than r, in Vi j(t) updating the neighborhood by adopting a Gaussian probability density function with the mean value of mu and the standard deviation of sigma to obtain a new speedIt is defined as formula (10):

wherein the mean value isStandard deviation ofThe j-th continuous variable value of all solutions in the memory table is jointly determined, and the formula is defined as formula (11) and formula (12):

the above formula combines each solution X for each continuous variableiDetermining standard deviation according to the fitness of the target; because the data is Gaussian probability distribution, the large data distribution of the standard deviation is more dispersed, and the small data distribution of the standard deviation is more concentrated; according to the fitness to data scaling, the disturbance of a poor solution to the good solution is reduced, and the standard deviation of the poor solution is increased, so that the poor solution can generate a better solution more probably;

finally, if the code is illegal in the updating process, the generated new speed value is not in the speed interval [ V ] with the possibility of taking awaymin,Vmax]When the new solution is less than the minimum velocity VminThen with VminTaking a symmetry point for the symmetry axis, when the new solution is greater than the maximum velocity VmaxThen with VmaxThe symmetry points are taken for the symmetry axes until a new solution is obtained.

Further, the discrete variable update strategy ACOMV-AComprises the following steps: at the base solution XiIn, for each bit discrete variableWherein j is more than or equal to 1 and less than or equal to d, and the updating is carried out by adopting a continuous relaxation method, and the method comprises the following steps: directly processing the discrete variable as a continuous value in the same process as the updating strategy of the continuous variable, comparing the result obtained by updating with the discrete points in the selectable set, and taking the discrete point closest to the continuous value as the updated discrete point

Compared with the prior art, the invention has the beneficial effects that: the generation of the fitness running personalized motion scheme is abstracted into an optimization problem with constraints and containing discrete variables and continuous variables, a fitness evaluation method with constraints and a solution updating method are provided, and the personalized fitness running motion scheme is generated based on the ant colony optimization algorithm of mixed coding, so that safe, effective and personalized guidance is provided for exercising and building on the running machine.

Drawings

FIG. 1 is a flow chart of an implementation of an embodiment of the present invention.

FIG. 2 is a memory-relief table in an embodiment of the present invention.

Detailed Description

The invention is described in further detail below with reference to the figures and the embodiments.

The invention provides a body-building running motion scheme generation method based on an ant colony optimization algorithm, which comprises the following steps of firstly defining a time sequence of a motion scheme solution space omega as shown in a formula (1):

Ω={X|X=<(V(1),A(1)),...,(V(t),A(t)),...,(V(l),A(l))>} (1)

wherein V (t) and A (t) respectively represent the speed and the gradient of the t-th time interval, l is the total time interval, and the speed value is determined by combining the characteristics of the speed and the gradient provided by the existing treadmillInterval [ V ]min,Vmax]Taking, from the set { A ], values belonging to continuous variables, of gradient1,A2,...,AnGet inside, belong to the discrete variable.

Defining the safe effective heart rate interval of the fitness run as formula (2):

safe and effective heart rate interval ═ 0.64HRmax,0.74HRmax] (2)

In the formula, HRmaxAt maximum heart rate, and HRmax220-age.

In solution X, the number of times the heart rate falls within the non-safe significant heart rate interval is defined as a function f (X) shown in equation (3):

in the formula (I), the compound is shown in the specification,is the predicted heart rate calculated by the fitness running motion model.

The fitness running motion scheme generation is described as a constrained hybrid coding optimization problem: searching for an optimal solution X satisfying formula (4) under the condition of satisfying formula (2):

then, as shown in fig. 1, the running exercise program is generated as follows:

(1) determining maximum evolution algebra g of ant colony optimization algorithmmaxThe number k of initial solutions, the number m of new solutions generated in each generation, the pheromone persistence epsilon, the coefficient q of the adjusting weight and the maximum heart rate HRmaxAnd initializing each variable and assigning the current evolution algebra g as 1.

(2) And randomly generating k solutions in the speed interval and the gradient set to obtain an initial solution memory table, wherein each solution in the solution memory table consists of r continuous variables and d discrete variables.

(3) And calculating the fitness value of each solution in the solution memory table, and sequencing the solutions from small to large according to the fitness values.

(4) If the current evolution algebra g is not more than the maximum evolution algebra gmaxAnd (5) if so, turning to the step (5), otherwise, turning to the step (8).

(5) Calculate the weight ω (X) of each solutioni) And obtaining m reference solutions X by using roulette samplingi,1≤i≤m。

(6) For each obtained reference solution XaAnd a is less than or equal to m, the following operations are carried out: updating strategy ACO with continuous variablesMV-VTo the benchmark solution XaEach continuous variable V (t) is updated to obtain a new solution X'aThen adopting a discrete variable updating strategy ACOMV-ATo newly dissolve X'aEach discrete variable A (t) in the solution is updated to obtain a new solution X "aThen evaluating the solution X "aTo obtain a fitness value F (X) "a) And is prepared by reacting X "aAs Xk+aStoring in a solution memory table; until the above operation is completed for all the reference solutions.

(7) And deleting the worst m solutions in the solution memory table, and sequencing the rest best k solutions according to the fitness from small to large. Then, add 1 to the current evolution algebra g, and return to step (4).

(8) And outputting the first ranked solution in the solution memory table as the optimal solution X.

As shown in FIG. 2, the solution memory table contains k complete solutions { X }1,X2,...,XkAnd the method for generating a new solution according to the solution in the solution memory table is to update continuous variables in sequence and then update discrete variables in sequence. Each solution consists of r continuous variables and d discrete variables, where r d l represents the total number of time segments. The solution memory table is dynamically updated as new solutions are generated.

The optimization goal generated by the body-building running scheme is to minimize the value of the objective function f, and the fitness is defined as formula (5):

F(Xi)=Rf+RD (5)

the above formula combines the constraint violation degree penalty functions of the target function formula (3), the formula (6) and the formula (7) of the formula (3), and introduces a comprehensive ranking mechanism。Rf、RDThe penalty functions are ranked from small to large for the objective function and the constraint violation degree, respectively. The fitness mainly meets the following three principles:

1)falls within the interval [0.64HRmax,0.74HRmax]The smaller the number of times of outside, the better.

2)The closer to the interval boundary the better its fitness value.

3) From the viewpoint of safety,fitness less than lower bound is better thanA fitness value greater than the upper boundary.

According to the fitness F (X)i) The solutions in the memory table are sorted from small to large to obtain the ranking of each solution and is marked as rank (X)i) Then calculate the solution XiWeight ω (X) ofi)。ω(Xi) Is about ranking rank (X)i) Is defined by the formula (8):

in the formula, q is a coefficient for adjusting the weight. After the weights are obtained, m reference solutions are obtained by sampling according to the probability defined by the formula (9) by adopting a roulette method. Ranking rank (X)i) The more advanced solutions have higher weights, and the higher the probability of being drawn as a reference solution.

The continuous variable update policy ACOMV-VComprises the following steps:

at the base solution XiIn, for each bit continuous variable Vi j(t), where j is not less than 1 and not more than r, in Vi j(t) updating the neighborhood by adopting a Gaussian probability density function with the mean value of mu and the standard deviation of sigma to obtain a new speedIt is defined as formula (10):

wherein the mean value isStandard deviation ofThe j-th continuous variable value of all solutions in the memory table is jointly determined, and the formula is defined as formula (11) and formula (12):

the above formula combines each solution X for each continuous variableiThe standard deviation is determined according to the fitness of the user. Because the data is Gaussian probability distribution, the data with large standard deviation is distributed more dispersedly, and the data with small standard deviation is distributed more intensively. According to the fitness to data scaling, the disturbance of the poor solution to the good solution can be reduced, and the poor solution can be scaledThe standard deviation can be increased so that it yields better solutions more likely.

Finally, if the code is illegal in the updating process, the generated new speed value is not in the speed interval [ V ] with the possibility of taking awaymin,Vmax]When the new solution is less than the minimum velocity VminThen with VminTaking a symmetry point for the symmetry axis, when the new solution is greater than the maximum velocity VmaxThen with VmaxThe symmetry points are taken for the symmetry axes until a new solution is obtained.

The discrete variable update strategy ACOMV-AComprises the following steps:

at the base solution XiIn, for each bit discrete variableWherein j is more than or equal to 1 and less than or equal to d, and updating is carried out by adopting a continuous relaxation method. In order to reduce the complexity of the optimization algorithm, the continuous relaxation method directly treats the discrete variable as a continuous value for processing, the processing process is the same as the updating strategy of the continuous variable, then the updated result is compared with the discrete points in the selectable set, and the discrete point closest to the continuous value is used as the updated discrete point

The above are preferred embodiments of the present invention, and all changes made according to the technical scheme of the present invention that produce functional effects do not exceed the scope of the technical scheme of the present invention belong to the protection scope of the present invention.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电针治疗系统及其数据优化方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!