Форум программистов, компьютерный форум, киберфорум
С++ для начинающих
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск  
 
 
Рейтинг 4.72/18: Рейтинг темы: голосов - 18, средняя оценка - 4.72
 Аватар для DiffEreD
1458 / 795 / 257
Регистрация: 21.06.2011
Сообщений: 1,740
Записей в блоге: 2

Ошибка: multiple definition of `void std::swap<A>(A&amp;, A&amp;)

04.08.2015, 19:46. Показов 4106. Ответов 46
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Хочу специализировать swap для своего класса. Получаю ошибку. Вот код:
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef A_H
#define A_H
 
#include <string>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const std::string &);
 
    void swap(A &) noexcept;
};
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "a.h"
#include <utility>
 
A::A(const std::string &s) : str(s)
{}
 
void A::swap(A &other) noexcept
{
    using std::swap;
    swap(str, other.str);
}
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
    lhs.swap(rhs);
}
 
}
main.cpp
C++
1
2
3
4
5
6
7
8
9
#include <iostream>
#include <utility>
#include "a.h"
 
int main()
{
    A a1("Hello"), a2("world");
    std::swap(a1, a2);
}
Ошибка для специализации: multiple definition of `void std::swap<A>(A&, A&) В чем проблема?
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
04.08.2015, 19:46
Ответы с готовыми решениями:

Выделение памяти для буффера, под std::istream& operator>>(std::istream &, String &)
Добрый день. Как осуществляется выделения памяти под перегруженный оператор ввода данных в пользовательский тип? Ведь мы заранее не можем...

в чем разница между void f(int &n) и void f(int &&n)
:help:

Почему friend ostrem& operator <<(ostream& outs, const Rational&); - invalid function declaration?
Пытаюсь скомпилировать программу пишет friend ostrem&amp; operator &lt;&lt;(ostream&amp; outs, const Rational&amp;); - invalid function declaration. ...

46
 Аватар для DiffEreD
1458 / 795 / 257
Регистрация: 21.06.2011
Сообщений: 1,740
Записей в блоге: 2
05.08.2015, 14:14  [ТС]
Студворк — интернет-сервис помощи студентам
Ilot, как вариант возьму на заметку. Но я все же хотел специализацию для std::swap сделать, не перегрузку.
Цитата Сообщение от ct0r Посмотреть сообщение
И ради всего святого не лезьте в пространство std.
Полные специализации вносить в std не запрещено.
0
Эксперт по математике/физикеЭксперт С++
 Аватар для Ilot
2226 / 1428 / 420
Регистрация: 16.05.2013
Сообщений: 3,651
Записей в блоге: 6
05.08.2015, 14:32
Лучший ответ Сообщение было отмечено DiffEreD как решение

Решение

Цитата Сообщение от DiffEreD Посмотреть сообщение
Ilot, как вариант возьму на заметку. Но я все же хотел специализацию для std::swap сделать, не перегрузку.
Как говорит один мужик: "Хрен один только вид сбоку".
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef A_H_INCLUDED
#define A_H_INCLUDED
 
#include <string>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const std::string &);
 
    void swap(A &) noexcept;
};
 
namespace std
{
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)));
}
#endif // A_H_INCLUDED
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "a.h"
#include <utility>
 
A::A(const std::string &s) : str(s)
{}
 
void A::swap(A &other) noexcept
{
    using std::swap;
    swap(str, other.str);
}
 
namespace std
{
template <>
void swap(A &lhs, A &rhs)
{
    lhs.swap(rhs);
}
}
Тут важна суть. А суть простая - вы не указали компилятору, что специализировали шаблон.
1
 Аватар для DiffEreD
1458 / 795 / 257
Регистрация: 21.06.2011
Сообщений: 1,740
Записей в блоге: 2
05.08.2015, 16:16  [ТС]

Не по теме:

Ну наконец то, то что я хотел



Добавлено через 1 час 31 минуту
Ilot, что то я не пойму тут один момент. В заголовке мы объявляем специализацию с пометкой noexcept. В исходнике пишем определение этой специализации уже без noexcept. Он, как бы там подразумеваеться по умолчанию. А то если его туда дописать, то ошибочка получаеться:
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
....
...
namespace std
{
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
   lhs.swap(rhs);
}
}
ошибка
ошибка: declaration of 'void std::swap(_Tp&, _Tp&) noexcept [with _Tp = A]' has a different exception specifier
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
^


Добавлено через 2 минуты
Типа разные спецификаторы исключений. Как так может быть - они же одинаковые.
0
Эксперт по математике/физикеЭксперт С++
 Аватар для Ilot
2226 / 1428 / 420
Регистрация: 16.05.2013
Сообщений: 3,651
Записей в блоге: 6
05.08.2015, 17:00
DiffEreD, смотрите исходники компилятора:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  template<typename _Tp>
    inline void
    swap(_Tp& __a, _Tp& __b)
#if __cplusplus >= 201103L
    noexcept(__and_<is_nothrow_move_constructible<_Tp>,
                is_nothrow_move_assignable<_Tp>>::value)
#endif
    {
      // concept requirements
      __glibcxx_function_requires(_SGIAssignableConcept<_Tp>)
 
      _Tp __tmp = _GLIBCXX_MOVE(__a);
      __a = _GLIBCXX_MOVE(__b);
      __b = _GLIBCXX_MOVE(__tmp);
    }
Вот только не говорите мне, что у вас условия совпадают . (С себя греха не снимаю - тоже не досмотрел...)
Просто подправьте спецификацию исключений и все будет зер гут:
C++
1
2
3
4
5
6
7
8
9
namespace std
{
template <>
void swap(A &lhs, A &rhs) noexcept(__and_<is_nothrow_move_constructible<A>,
                is_nothrow_move_assignable<A>>::value)
{
    lhs.swap(rhs);
}
}
1
 Аватар для DiffEreD
1458 / 795 / 257
Регистрация: 21.06.2011
Сообщений: 1,740
Записей в блоге: 2
05.08.2015, 21:46  [ТС]
Итак, под итожим.
Что бы добавить свою специализацию функции swap в пространство имен std для своего не шаблонного класса можно использовать три варианта:

Вариант 1 (самый простой) - это добавить специализацию в оддельный заголовок:
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef A_H
#define A_H
 
#include <string>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A(A &&rhs) noexcept;
    A& operator =(const A &rhs);
    A& operator =(A &&rhs) noexcept;
 
    void swap(A &rhs) noexcept;
};
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A::A(A &&rhs) noexcept : str(std::move(rhs.str)) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
A& A::operator =(A &&rhs) noexcept
{
    if (&rhs == this) return *this;
    str = std::move(rhs.str);
    return *this;
}
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
swap.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef SWAP
#define SWAP
 
#include <iostream>
#include "a.h"
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
    std::cout << "swap<A>()\n";
    lhs.swap(rhs);
}
 
}
 
#endif // SWAP
main
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <utility>
#include "a.h"
#include "swap.h"
 
int main()
{
    A a1("a"), a2("b");
    std::swap(a1, a2);
 
    std::cout << std::boolalpha;
    std::cout << "A::swap() is noexcept:       " << (noexcept(a1.swap(a2))) << "\n"; //true
    std::cout << "std::swap(A, A) is noexcept: " << (noexcept(std::swap(a1, a2))) << "\n"; //true
}


Вариант 2 (не до конца мною понятен и под вопросом производительности) - это определить специализацию в заголовке файла класса с пометкой inline:
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef A_H
#define A_H
 
#include <string>
#include <iostream>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A(A &&rhs) noexcept;
    A& operator =(const A &rhs);
    A& operator =(A &&rhs) noexcept;
 
    void swap(A &rhs) noexcept;
};
 
 
namespace std
{
 
template <>
inline void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
    std::cout << "inline swap<A>()\n";
    lhs.swap(rhs); // здесь может быть много строк кода, inline наверное плохая идея
}
 
}
 
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A::A(A &&rhs) noexcept : str(std::move(rhs.str)) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
A& A::operator =(A &&rhs) noexcept
{
    if (&rhs == this) return *this;
    str = std::move(rhs.str);
    return *this;
}
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
main
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <utility>
#include "a.h"
 
int main()
{
    A a1("a"), a2("b");
    std::swap(a1, a2);
 
    std::cout << std::boolalpha;
    std::cout << "A::swap() is noexcept:       " << (noexcept(a1.swap(a2))) << "\n"; //true
    std::cout << "std::swap(A, A) is noexcept: " << (noexcept(std::swap(a1, a2))) << "\n"; //true
}


Вариант 3 (могут возникнуть непонятные проблемы со спецификаторами исключений) - это сначала обвить в заголовке класса специализацию, а в реализации класса написать определение:
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef A_H
#define A_H
 
#include <string>
#include <iostream>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A(A &&rhs) noexcept;
    A& operator =(const A &rhs);
    A& operator =(A &&rhs) noexcept;
 
    void swap(A &rhs) noexcept;
};
 
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)));
 
}
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A::A(A &&rhs) noexcept : str(std::move(rhs.str)) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
A& A::operator =(A &&rhs) noexcept
{
    if (&rhs == this) return *this;
    str = std::move(rhs.str);
    return *this;
}
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
    std::cout << "swap<A>()\n";
    lhs.swap(rhs);
}
 
}
main
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <utility>
#include "a.h"
 
int main()
{
    A a1("a"), a2("b");
    std::swap(a1, a2);
 
    std::cout << std::boolalpha;
    std::cout << "A::swap() is noexcept:       " << (noexcept(a1.swap(a2))) << "\n"; //true
    std::cout << "std::swap(A, A) is noexcept: " << (noexcept(std::swap(a1, a2))) << "\n"; //true
}

Вариант 3 у меня на работе на gcc 5.1.0 32bit не компилировался из за непонятных несоответствий спецификатора исключений noexcept. Дома, на gcc 5.1.0 64bit - все работает. Завтра еще раз проверю.

Буду рад услышать любые замечания.
0
What a waste!
 Аватар для gray_fox
1612 / 1304 / 180
Регистрация: 21.04.2012
Сообщений: 2,735
05.08.2015, 22:02
Цитата Сообщение от DiffEreD Посмотреть сообщение
Вариант 1
Плохой вариант. Не надо делать так, что бы заголовочный файл нельзя было включать в несколько файлов с исходным кодом.
1
 Аватар для DiffEreD
1458 / 795 / 257
Регистрация: 21.06.2011
Сообщений: 1,740
Записей в блоге: 2
05.08.2015, 23:18  [ТС]
Замечание по варианту 3: важно чтобы операторы перемещения класса были помечены спецификатором noexcept. В противном случае надо будет добавлять спецификаторы в специализацию самому. Примерно вот так:
операторы перемещения отсутствуют или объявлены как default
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef A_H
#define A_H
 
#include <string>
#include <iostream>
#include <utility>
#include <type_traits>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A& operator =(const A &rhs);
 
    A(A &&rhs) = default;
    A& operator =(A &&rhs) = default;
 
    void swap(A &rhs) noexcept;
};
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)) &&
                                   std::is_nothrow_move_constructible<A>::value &&
                                   std::is_nothrow_move_assignable<A>::value);
 
}
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
 
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)) &&
                                   std::is_nothrow_move_constructible<A>::value &&
                                   std::is_nothrow_move_assignable<A>::value)
{
    std::cout << "swap<A>()\n";
    lhs.swap(rhs);
}
 
}
вывод
swap<A>()
A::swap()
A::swap() is noexcept: true
std::swap(A, A) is noexcept: false
Спецификатор исключения для std::swap<A> выводится как false

операторы перемещения помечены как noexcept
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef A_H
#define A_H
 
#include <string>
#include <iostream>
#include <utility>
#include <type_traits>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A& operator =(const A &rhs);
 
    A(A &&rhs) noexcept;
    A& operator =(A &&rhs) noexcept;
 
    void swap(A &rhs) noexcept;
};
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)) &&
                                   std::is_nothrow_move_constructible<A>::value &&
                                   std::is_nothrow_move_assignable<A>::value);
 
}
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
 
A::A(A &&rhs) noexcept : str(std::move(rhs.str)) {}
A& A::operator =(A &&rhs) noexcept
{
    if (&rhs == this) return *this;
    str = std::move(rhs.str);
    return *this;
}
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)) &&
                                   std::is_nothrow_move_constructible<A>::value &&
                                   std::is_nothrow_move_assignable<A>::value)
{
    std::cout << "swap<A>()\n";
    lhs.swap(rhs);
}
 
}
вывод
swap<A>()
A::swap()
A::swap() is noexcept: true
std::swap(A, A) is noexcept: true
Спецификатор исключения для std::swap<A> выводится как true

Или:
операторы перемещения помечены как noexcept
a.h
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef A_H
#define A_H
 
#include <string>
#include <iostream>
#include <utility>
#include <type_traits>
 
class A
{
    std::string str;
public:
    A() = default;
    A(const char* s);
    A(const A &rhs);
    A& operator =(const A &rhs);
 
    A(A &&rhs) noexcept;
    A& operator =(A &&rhs) noexcept;
 
    void swap(A &rhs) noexcept;
};
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)));
 
}
 
#endif // A_H
a.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "a.h"
 
#include <iostream>
#include <utility>
 
A::A(const char* s) : str(s) {}
A::A(const A &rhs) : str(rhs.str) {}
A& A::operator =(const A &rhs)
{
    if (&rhs == this) return *this;
    str = rhs.str;
    return *this;
}
 
A::A(A &&rhs) noexcept : str(std::move(rhs.str)) {}
A& A::operator =(A &&rhs) noexcept
{
    if (&rhs == this) return *this;
    str = std::move(rhs.str);
    return *this;
}
 
void A::swap(A &rhs) noexcept
{
    std::cout << "A::swap()\n";
    using std::swap;
    swap(str, rhs.str);
}
 
namespace std
{
 
template <>
void swap(A &lhs, A &rhs) noexcept(noexcept(lhs.swap(rhs)))
{
    std::cout << "swap<A>()\n";
    lhs.swap(rhs);
}
 
}
вывод
swap<A>()
A::swap()
A::swap() is noexcept: true
std::swap(A, A) is noexcept: true
Спецификатор исключения для std::swap<A> выводится как true
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
05.08.2015, 23:18

В заштрихованную фигуру бросают точки с координатами x и y. Получить координаты первой точки не попавшей в эту область (фигура x*x+y*y<25&&x*x+y*y>=9&
В заштрихованную фигуру бросают точки с координатами x и y. Получить координаты первой точки не попавшей в эту область (фигура...

ostream &operator<< (ostream &output, const Array &obj) - что означает эта строка?
void Array::getArray() // вывод массива { for (int ix = 0; ix &lt; size; ix++) cout &lt;&lt; setw(5) &lt;&lt; ptr; // вывод элементов...

Порядок вычисления: операторы «|» и «||», «&» и «&&»
В Java булевые операторы «|» и «||», и «&amp;» и «&amp;&amp;» отличаются друг от друга порядком вычеслений, а в C++ так же как и в Java или...

Parse_matrix(std::istream& in); std::istream& in что это значит?
Есть функция которую необходимо описать: std::pair&lt;int, int&gt; parse_matrix(std::istream&amp; in){ return{ 0,0 }; } Но я не...

Friend ostream& operator<<(ostream& stream, CArr& obj);
CArr.h #pragma once class CArr{ int* arr = nullptr; int size = 10; void swap(int *a, int *b); void swap(int &amp;a, int &amp;b); ...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
47
Ответ Создать тему
Новые блоги и статьи
Алиса нашла кучу ошибок компиляции и запуска в проекте, который без проблем компилировался и запускался)))
anaschu 30.06.2026
Я пока посмеюся, но завтра проверю. А вообще интерсно. Дал алисе файл, в котором точно нет ошибок компиляции и запуска, и попросил их найти. Нашла кучу))) Критические ошибки, мешающие компиляции и. . .
сукцессия 16. Общий обзор, в основном что бы другие ии поняли
anaschu 29.06.2026
# Передаточный документ: модель микоризной сукцессии (для нового чата) Этот документ предназначен для того, чтобы новый чат Claude мог продолжить работу без необходимости заново разбираться в. . .
сукцессия 15 неявная схема
anaschu 29.06.2026
Алиса Калибровка параметров симбиотической модели: технический обзор Содержание: Введение Постановка проблемы Технические аспекты реализации Процесс внедрения изменений
сукцессия 14. Обновленная схема модели
anaschu 28.06.2026
ГЛОБАЛЬНАЯ ОПИСАТЕЛЬНАЯ СПЕЦИФИКАЦИЯ ЭКОСИСТЕМНОЙ МОДЕЛИ «SOIL CHEMISTRY & MYCORRHIZA 2. 0» https:/ / ibb. co/ NnkGpfMd Представленная интегрированная схема описывает непрерывную нелинейную. . .
сукцессия 13. Питон модель трехзонного мицелия, пока что в основном арбускулярного
anaschu 28.06.2026
## Разработка агентной модели микоризной сукцессии: от выявления артефактов к созданию комплексной системы ### Аннотация Представлено исследование по разработке агентной модели микоризной. . .
сукцессия 12. краткий список проверок модели перед запуском.
anaschu 27.06.2026
Скрытые отказы в моделях систем динамики (SD-models) экологических систем: два случая из практики Контекст Разбирался прототип модели систем динамики (SD-модели) микоризной сукцессии: пять. . .
Сукцессия 11. Проверка орудий перед войной: разработка через тестирование
anaschu 27.06.2026
Как не дать модели соврать самой себе: проверки для симуляции микоризной сукцессии Введение Когда вы строите математическую модель живой системы — грибов, растений, почвы — главная опасность. . .
10 сукцессия. Питон код войны грибов и растений
anaschu 27.06.2026
import numpy as np class PlantAgent: def __init__(self, name, strategy, initial_biomass): self. name = name self. strategy = strategy # "greedy" (широколиственные) или. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru