Skip to content

Commit 76d0512

Browse files
committed
Added hw7 submission details.
1 parent 3aae06f commit 76d0512

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/src/lecture_04/hw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Homework 4: More Unit Tests
1+
# [Homework 4: More Unit Tests](@id hw4)
22

33

44
In this homework you will finish writing your unit tests for your `Ecosystem.jl`.

docs/src/lecture_07/hw.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# [Homework 7: Creating world in 3 days/steps](@id hw07)
22

3+
## How to submit
4+
Put all the code of inside `hw.jl`. Zip only this file (not its parent folder) and upload it to BRUTE. You should assume that only
5+
```julia
6+
using Ecosystem
7+
using Ecosystem.EcosystemCore
8+
```
9+
will be put before your file is executed, but do not include them in your solution. The version of `Ecosystem` pkg and consequently `EcosystemCore` should be the same as in [HW4](@ref hw4).
10+
311
```@raw html
412
<div class="admonition is-category-homework">
513
<header class="admonition-header">Homework (2 points)</header>
@@ -17,7 +25,7 @@ end
1725
`@add` should not be treated as a macro, but rather just as a syntax, that can be easily matched.
1826

1927
As this is not a small task let's break it into 3 steps
20-
1. Define method `default_config(::Type{T})` for each `T` in `Grass, Wolf,...`, which returns a tuple of default parameters for that particular agent.
28+
1. Define method `default_config(::Type{T})` for each `T` in `Grass, Wolf,...`, which returns a named tuple of default parameters for that particular agent (you can choose the default values however you like).
2129
2. Define method `_add_agents(max_id, count::Int, species::Type{<:Species})` and `_add_agents(max_id, count::Int, species::Type{<:AnimalSpecies}, sex::Type{<:Sex})` that return an array of `count` agents of species `species` with `id` going from `max_id+1` to `max_id+count`. Default parameters should be constructed with `default_config`.
2230
3. Define the underlying function `_ecosystem(ex)`, which parses the block expression and creates a piece of code that constructs the world.
2331

0 commit comments

Comments
 (0)