Presentation is loading. Please wait.

Presentation is loading. Please wait.

GTECH 731 Lab Session 10 11/2/10 Lab 8 – Simple Agent Model Review Exploring ArcObjects Lab 9 – ArcObjects.

Similar presentations


Presentation on theme: "GTECH 731 Lab Session 10 11/2/10 Lab 8 – Simple Agent Model Review Exploring ArcObjects Lab 9 – ArcObjects."— Presentation transcript:

1 GTECH 731 Lab Session 10 11/2/10 Lab 8 – Simple Agent Model Review Exploring ArcObjects Lab 9 – ArcObjects

2 Lab 8 – Simple Agent Model Create simple Agent model With Pedestrian, Obstacle and Goal objects Pedestrians move towards closest Goal Originally moved in 1 of 4 directions along longest of 2 component directions (vertical or horizontal) Changed pedestrian to move directly to goal along straight line “Obstacles” in scene blocked paths to goal Pedestrian detected “hit” of object and could not move forward Problem: What do you do when a “Pedestrian” hits an object? How does it go around an object?

3 Lab 8 – Original Logic Not Sophisticated Enough 1.For each tick of the clock 1.If there are goals and a goal has not been reached 1.Find the closest goal 1.Look at all of the goals and select the closest one 2.Determine direction to that goal 1.Calculate two component directions (vertical or horizontal) to the goal and select the longer of the 2 directions 3.While in old position 1.Move one step in selected direction 2.If object is hit 1.Move back to old position 2.Change selected direction 1. If moving North, move East 2. If moving East, move South 3. If moving South, move West 4. If moving West, move North 2.What other options are there when a pedestrian hits an object?

4 Lab 8 – My “Solution” When Object Hit 1.If object is hit 1.Move back to old position 2.Count # of Tries 3.Change selected direction 1.If # tries is even 1.Rotate 120  2.Else # tries is odd 1.Rotate -120  3.Move “Step Distance” + # Tries 2.Negotiated around “convex” edges 3.Did not work with objects having “concave” edges 120 

5 1.If object is hit 1.Move back to old position 2.Change selected direction 1.Rotate some other fixed angle (5, 10, 25 etc.) from the current angle 2.Move “Step Distance” OR 1.If object is hit 1.Move back to old position 2.Change selected direction 1.Set Random Angle to travel 2.Move “Step Distance” Lab 8 – Alternatives to My “Solution” 120 

6 Lab 8 – Follow Edge Of Obstacle 1.If object is hit 1.Determine “Edge Hit” 2.Move back to old position 3.Make last point in “Edge Hit” a “Temporary Goal” 4.If temporary goal not “reached” 1.Move toward “Temporary Goal” 5.Else 1.Determine “Next Edge” 2.Make last point in “Next Edge” the “Temporary Goal” Problem might be defining “reaching” temporary goal Does Pedestrian need to go beyond temporary goal so as not to hit the same edge when it resumes travelling toward ultimate goal? Might need extra variable saying pedestrian is travelling along edge or to say which edge How do you tell when you are around the obstacle? 2 1 5 4 3

7 Exploring ArcObjects Like to Geotools, ArcObjects compiled into DLL file and included in any project In code, right click and select “Go to definition” for... Idocument AppRef Parent { get; } IApplication Variables: bool Visible { get; set; }; string Caption { get; set; } Methods: void RefreshWindow(); void Shutdown(); void NewDocument(bool selectTemplate, string templatePath); void OpenDocument(string path);

8 Exploring ArcObjects In code, right click and select “Go to definition” for... MXDocumentClass AppRef Parent { get; } IMxDocument IMap FocusMap { get; } Imap int LayerCount { get; } ILayer get_Layer(int Index); void MoveLayer(ILayer Layer, int toIndex); Basic information about the ArcObjects Library is available at: http://edndoc.esri.com/arcobjects/9.2/welcome.htm, under “ArcObjects Library Reference”. http://edndoc.esri.com/arcobjects/9.2/welcome.htm

9 Lab 9 – Preview Look at Lab assignment


Download ppt "GTECH 731 Lab Session 10 11/2/10 Lab 8 – Simple Agent Model Review Exploring ArcObjects Lab 9 – ArcObjects."

Similar presentations


Ads by Google