-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplans
More file actions
99 lines (78 loc) · 3.67 KB
/
plans
File metadata and controls
99 lines (78 loc) · 3.67 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---------------------
Initial outline
---------------------
Given the set of descriptions, output all possible layouts that fit the constraints
- constraint satisfaction based on all given descriptions
- aay have free variables/multiple possible valid results
- always contains the intended correct result
Input descriptions in succession and output the updated possible layouts after each additional constraint
- allow for input updating new relations
- most recent output of layouts fits all constraints given up to and including the most recently added one
Extras
- Parameters: error type, probability of error
- Error types: left/right or top/down switches, flips/rotations, ...
- Probability of error: alter layouts to reflect the given error type according to the given probability
- Throw error if constraint(s) are impossible to realize for any of the layouts up to date?
---------------------
Update 4/16/2013
---------------------
More Ideas:
Use "relation" instead of "position"
Create class of positions
Methods to add the positions such as: Dog.leftOf(Cat)
For now, have relations be in straight lines (same column/row)
Position adding methods test the 'in same line' constraint separately for easy future removal
Have a nxn grid, where n is the total number of rooms, to incorporate all possible layouts
Maintain a grid for each room and block out impossible locations given the constraints
To get the final layout formation, overlay the grids and find the intersections.
---------------------
Update 4/22/2013
---------------------
Classes: Room, Grid, Experiment
Room
- item: animal in it
- grid of possible locations for this room
- location of this room
(commented out in code for now, unsure if needed)
- set neighbours by relations
Grid
- represents the nxn grid that can accomodate all possibilities for n total number of rooms
- represent invalid locations
- toString for easy testing and printing results
Experiment
- the "main" method
- generate list all possible grids/layouts
**Questions**
line 10: how to get grid size without making room keep track of total number of rooms
(which seems inappropriate for abstraction concerns); some java static variable equivalent in python?
Alternative Ideas
- Digraph representation
- Edges with direction/relation identifiers (left/right/top/bottom)
---------------------
Update 4/23/2013
---------------------
"World" instead of "Grid"
Change Grid (now World) to store the list of rooms you have (independent of locations, locations only stored in Room)
Add a dictionary, each key is the animal, each value is the list of all possible locations (Rooms)
Experiment
With each added constraint, print out information about the update
Unit test: start with 3x3 and 2 animals, make sure worlds that you know should exist do in fact show up as possible
---------------------
Update 4/30/2013
---------------------
Goals to reach before next meeting:
- Complete unit testing and debugging
- Debug program for running from main() and handling user input appropriately
- Ensure program is usable to begin testing constraints
- Check that code is fully documented as needed
---------------------
Update 5/07/2013
---------------------
Goals for next meeting:
- Program is now working, keep on the lookout for bugs by trying it out more
- Test ways to increase effeciency: reduce appending, check loops for repeated testing with constraints, reduce loops
- Memoization: Rooms, Worlds
__new__ gets called before the object is even created (see example in Room in spatial_learning.py)
do the same thing with world
- Use sets with worlds to see if one already exists then don't duplicate it
- Checkout stackoverflow question on python's use of init and new