VR-Forces 4.3.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
examples
radarWarnRx
simpleRdrWrnResp.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2003 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: simpleRdrWrnResp.h,v $ $Revision: 1.7 $ $State: Exp $
7
*******************************************************************************/
8
9
#ifndef DtSimpleRadarWarningResponse_H_
10
#define DtSimpleRadarWarningResponse_H_
11
12
#include "
vrfmodel/fixedWingPilotController.h
"
13
14
//class DtSimpleRadarWarningResponse:
15
//
16
//Instances of DtSimpleRadarWarningResponse are an example of a controller
17
//that implements a reactive behavior when a it receives sensor input that
18
//a radar has been detected. It receives a list of emitter systems (hostile
19
//radar systems). It takes the first emitter in the list and flys away to
20
//a location in the opposite direction.
21
22
class
DtVrfObject
;
23
class
DtEntityListInputPort
;
24
25
class
DtSimpleRadarWarningResponse
:
public
DtFixedWingPilotController
26
{
27
public
:
28
29
//constructor
30
DtSimpleRadarWarningResponse
(
const
DtString
&
name
,
DtVrfObject
* owner,
31
DtSimManager
*
simManager
,
DtComponentDescriptor
* desc = NULL,
32
DtReaderWriterRegistry
*
const
parentRegistry = 0);
33
34
35
//destructor
36
virtual
~DtSimpleRadarWarningResponse
();
37
38
//This returns a string that uniquely identifies this type of component.
39
//(must be unique with respect to the component types defined in compTypes.h
40
//as well as any additional user-defined components). Returns the string
41
//"simple-radar-warning-response".
42
virtual
DtString
type
()
const
;
43
44
//Calculate new control values.
45
virtual
void
tick
();
46
47
//Returns a newly created instance of this class. We need to provide
48
//this function so that we can register this class with the component
49
//factory.
50
static
DtSimComponent
*
creator
(
const
DtString
& name,
DtVrfObject
* owner,
51
DtSimManager
* simManager,
DtComponentDescriptor
* desc,
52
DtReaderWriterRegistry
* parentRegistry);
53
54
protected
:
55
56
//Called by DtSimComponent::init to create myEntityListPort used to manage
57
//multiple sensors that might provide targets to this controller.
58
virtual
bool
createPorts
();
59
60
//Looks up safe control point by name. If the object exists and it has
61
//a valid state repository, returns the object. Otherwise returns NULL.
62
virtual
DtVrfObject
*
getControlPoint
(
const
DtString
& name);
63
64
//Returns true if we are in the vicinity of the given position. To be
65
//in the vicinity of the position means that we are within 5 seconds of
66
//the given location, given our ordered speed.
67
virtual
bool
inVicinity
(
const
DtVector
& localPosition);
68
69
protected
:
70
71
//default constructor
72
DtSimpleRadarWarningResponse
();
73
74
//copy constructor, not implemented
75
DtSimpleRadarWarningResponse
(
const
DtSimpleRadarWarningResponse
& orig);
76
77
//assignment operator, not implemented
78
DtSimpleRadarWarningResponse
&
operator=
(
const
DtSimpleRadarWarningResponse
& orig);
79
80
protected
:
81
82
//Port though which the list of hostile emitter systems will be received.
83
DtEntityListInputPort
*
myEmitterListPort
;
84
85
//true while in state of reacting to the detection of an emitter.
86
bool
myReactingToWarning
;
87
88
//Name of the safe location (a control point) we can retreat to.
89
DtString
mySafeControlPointName
;
90
91
DtVector
myLocalGoal
;
92
};
93
94
#endif
95
Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)