Читать реферат по информационным технологиям: "РАЗРАБОТКА ИГРЫ В ВИРТУАЛЬНОЙ РЕАЛЬНОСТИ НА ТЕМУ СЕЛЕКЦИИ ПЧЕЛ НА ОСНОВЕ СТОХАСТИЧЕСКИХ ПРОЦЕССОВ" Страница 30
"BeeGenetic.h" const float COMB_AMOUNT_PER_MINUTE = 0.5f; // Sets default values for this component's properties
UBeeGenetic::UBeeGenetic()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = false; // ...
} // Called when the game starts
void UBeeGenetic::BeginPlay()
{
Super::BeginPlay(); // ... } void UBeeGenetic::Init(TEnumAsByte main, TEnumAsByte sec, int32 speed, int32 fertility)
{
Main = main;
Sec = sec;
Speed = speed;
Fertility = fertility;
} // Called every frame
void UBeeGenetic::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // ...
} int32 UBeeGenetic::GetSpeedValue()
{
int32 count = 0;
int32 mask = 1;
for (int i = 0; i < 8; ++i)
{
if (mask & Speed)
++count;
mask Main : p2->Sec;
mutate(speciesP1, speciesP2);
//UE_LOG(LogTemp, Log, TEXT("Start inherit speed gen"));
int32 speed = inherit(p1->Speed, p2->Speed, SPEED_GENS_COUNT);
//UE_LOG(LogTemp, Log, TEXT("Start inherit fertility gen"));
int32 fertility = inherit(p1->Fertility, p2->Fertility, FERTILITRY_GENS_COUNT);
return UBeeGenetic::Construct(speciesP1, speciesP2, speed, fertility);
} UBeeGenetic *UInheritMutationLibrary::CopyBeeProps(const UBeeGenetic *from)
{
if (from)
return UBeeGenetic::Construct(from->Main, from->Sec, from->Speed, from->Fertility);
else
return UBeeGenetic::Construct(Species::Meadow, Species::Meadow, 0, 0);
} 1 Деятельность организации «Meta» признана экстремистской и запрещена на территории Российской Федерации
Похожие работы
Интересная статья: Быстрое написание курсовой работы

(Назад)
(Cкачать работу)