CN104268002B - A kind of simulation object visual development environment implementation method based on port encapsulation - Google Patents

A kind of simulation object visual development environment implementation method based on port encapsulation Download PDF

Info

Publication number
CN104268002B
CN104268002B CN201410519285.XA CN201410519285A CN104268002B CN 104268002 B CN104268002 B CN 104268002B CN 201410519285 A CN201410519285 A CN 201410519285A CN 104268002 B CN104268002 B CN 104268002B
Authority
CN
China
Prior art keywords
pel
simulation
event
simulation object
panel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410519285.XA
Other languages
Chinese (zh)
Other versions
CN104268002A (en
Inventor
姚益平
朱峰
鄢来斌
姚锋
唐文杰
蒋志文
曲庆军
陈慧龙
孟冬
胡腾飞
刘元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201410519285.XA priority Critical patent/CN104268002B/en
Publication of CN104268002A publication Critical patent/CN104268002A/en
Application granted granted Critical
Publication of CN104268002B publication Critical patent/CN104268002B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A kind of simulation object visual development environment implementation method based on port encapsulation, step are as follows: (1) configure simulation object and describe file content;(2) Simulation Calculation resource management module is constructed, it is automatic to traverse Simulation Calculation resource folder, Simulation Calculation is imported into Simulation Calculation management module, Simulation Calculation pel is loaded on Simulation Calculation resource management panel;(3) simulation object functional assembly pel panel is constructed, by initialization pel, event pel, event scheduling pel, event cancel pel, input/output end port pel is loaded on simulation object functional assembly pel panel;(4) the simulation object visual assembly module based on port encapsulation is constructed, successively realizes the submodule for forming the module;(5) building simulation object describes file automatically-generating module.The present invention has many advantages, such as stand-alone development that is easy to operate, supporting simulation object, improves simulation object development efficiency, improves simulation object reusability.

Description

A kind of simulation object visual development environment implementation method based on port encapsulation
Technical field
Present invention relates generally to modeling and simulation technology fields, and it is visual to refer in particular to a kind of simulation object based on port encapsulation Melt hair ring border implementation method.
Background technique
Since studying Parallel Discrete Event Simulation technology since the developed countries such as America and Europe the 1990s, phase After being proposed multiple Parallel Discrete Event Simulation run time infrastructure, such as SPEEDES, Parsec, YH-SUPE.These are parallel Discrete events simulation back-up environment is widely used in large scale ecological environmental simulation, computational system biology emulation, country and state It is complication system and complexity problem in the complication systems Simulation Applications such as anti-strategic research, crisis prediction and warning and disposition decision Research provide important scientific experiment Method and kit for.
Parallel Discrete Event Simulation (PDES, Parallel Discrete Event Simulation) uses event-driven Modeling pattern, each simulation object (Simulation Object) of complicated composition system is modeled, between simulation object lead to It crosses event scheduling and realizes data exchange and communication, entire analogue system is handled by concurrent event and promoted.Based on parallel from Dissipate event simulation technology scale complex system Simulation Application composed structure as shown in Figure 1, this kind of Simulation Application often by A large amount of simulation object is constituted, and the realization of each simulation object is by an initialization function (Initial Function) and more A event handling function (Event Handling Function) is constituted.Wherein, initialization function be used for simulation object into Row initialization process, event handling function inside include multiple Simulation Calculations (Simulation Computational Model), realize that the behavior of simulation object handles logic by dispatching the execution of these Simulation Calculations.
With deepening continuously for complication system Simulation Application, the scale of simulation object is increasing, what simulation object included Simulation Calculation becomes increasingly complex, and the model information needed to configure is more and more, due to lacking intuitive, efficient simulation calculation Model assemble method, leads to that the development efficiency of simulation object is low, difficulty is big.Secondly, these simulation objects often relate to it is numerous not The professional knowledge of same domain, and there is complicated interactive relation between simulation object, this just needs different field expert to assist jointly Quotient is just able to achieve simulation object built-in function and external interactive relation, to be difficult to meet simulation object distribution stand-alone development Demand.Simultaneously as the continuous variation of complication system simulation analysis demand, this kind of Simulation Application needs continuous integrated emulation pair As simulation developer is often desirable to the simulation object that will have been developed reuse into this kind of Simulation Application with contracting in this process The short application and development period, and reuse these simulation objects and be intended to modify its external interactive relation having had been carried out, increase Big reuse workload of the simulation object between different Simulation Applications.Therefore, complication system Simulation Application Efficient Development is realized Key points and difficulties are how intuitive, quick, independently developed simulation object, and its zero between different Simulation Applications is supported to repair Change reuse.
The development approach of traditional " piling up code " formula generally requires simulation modeling personnel, and to study parallel discrete event in depth imitative Genuine basic theoretical knowledge, it is skilled to grasp Parallel Discrete Event Simulation related platform technology, lead to the exploitation threshold of simulation object Height, period are long.Visual development technology has abstraction hierarchy more higher than code and closer to Problem Areas, is imitated using existing True computation model visual assembly is at simulation object, and the Parallel Discrete Event Simulations technology such as shield parallel processing, event scheduling Details improves development efficiency so as to which the exploitation threshold of complication system Simulation Application is effectively reduced.In recent years, right both at home and abroad Parallel Discrete Event Simulation visual development technology is paid much attention to, and multinomial achievement, including FLAMES, Pave, VisKit are achieved Deng.
FLAMES(Flexible Analysis, Modeling and Exercise System) it is U.S. Ternion A commercialized simplation visualizing integrated system that company releases.Simulation modeling personnel are by directly inheriting what FLAMES was provided Model base class hand-coding realizes specific simulation object event handling logic.Shortcoming, which is that, to be unable to satisfy and will have Computation model visual assembly is the demand of simulation object, and the coupling of the simulation object based on FLAMES is close, it is difficult to will The simulation object developed is reused into multiple and different Simulation Applications.
Pave(Parsec Visual Environment) it is a kind of imitating towards Parsec platform that U.S. UCLA is proposed Really apply visual development environment.Pave uses controlling stream graph CFG(Control Flow Graph) it is used as discrete events simulation The visual description normal form of system, uses artificial physical as basic modeling element.However its shortcoming is that CFG It is unsuitable for directviewing description discrete event system, and it is simulation object that Pave, which is not able to satisfy using existing computation model visual assembly, Demand;And based on the simulation object of Pave exploitation, interactive relation needs to realize in advance, if answering it in different emulation It is reused with, then the larger workload for needing to modify.
VisKit is the visual development environment towards discrete event system simulation that United States Naval Postgraduate School proposes. VisKit occurrence diagram modeling normal form in introduce Object -Oriented Model thought, propose monitor occurrence diagram object (LEGO, Listener Event Graph Objects).LEGO can be used for describing simulation object, between LEGO by monitoring mechanism into Row interaction.Its shortcoming is that VisKit generally requires manual programming and adds computation model in event handling logic Scheduling logic is not able to satisfy the demand by computation model visual assembly for simulation object.Meanwhile " monitoring " object need with " monitored " object occurs in pairs, thus limits the independence and reusability of simulation object.
In short, support the platform environment of simulation object visual development to be among research and development at present, it is existing imitative True object visual development environment is primarily present the problem of following three aspects:
(1) it is not able to satisfy the demand by Simulation Calculation visual assembly for simulation object;
(2) it is not able to satisfy the demand of simulation object distribution stand-alone development;
(3) it is not able to satisfy the simulation object demand that zero modification reuses in different Simulation Applications.
Therefore, there is an urgent need to a kind of new simulation object visual development environment, to promote complication system Simulation Application Development.
Summary of the invention
The technical problem to be solved in the present invention is that, for technical problem of the existing technology, the present invention provides one Kind principle stand-alone development that is simple, easy to operate, supporting simulation object improves simulation object development efficiency, improves simulation object The simulation object visual development environment implementation method based on port encapsulation of reusability.
In order to solve the above technical problems, the invention adopts the following technical scheme:
A kind of simulation object visual development environment implementation method based on port encapsulation, the steps include:
(1) configuration simulation object describes file content;What determination must configure during visual assembly simulation object Information describes the content of file as simulation object, and then constitutes the meta-model that simulation object describes file;
(2) Simulation Calculation resource management module is constructed, it is automatic to traverse Simulation Calculation resource folder, it will emulate Computation model imports Simulation Calculation management module, and Simulation Calculation pel is loaded into Simulation Calculation resource pipe It manages on panel;
(3) simulation object functional assembly pel panel is constructed, pel, event pel, event scheduling pel, thing will be initialized Part cancels pel, input/output end port pel is loaded on simulation object functional assembly pel panel;
(4) the simulation object visual assembly module based on port encapsulation is constructed, successively realizes the submodule for forming the module Block, including simulation object flow of event visual configuration panel, simulation object incident visualization configured board, Simulation Calculation can It can depending on changing configured board, initialization function visual configuration panel, input/output end port visual configuration panel, event scheduling Depending on changing configured board, event cancels visual configuration panel;
(5) building simulation object describes file automatically-generating module, realizes that simulation object describes the calculation that file automatically generates The visual simulating object information constructed using port encapsulation mode is stored to simulation object and is described in file, then led to by method It crosses to reuse the simulation object and describe file and realizes reuse of the simulation object between different Simulation Applications.
As a further improvement of the present invention: the meta-model that the simulation object describes file includes that simulation object is believed substantially Cease collection, simulation object initialization information collection, simulation object event information collection, input/output end port information collection;Simulation object is basic Information collection, for describing the essential information of simulation object, including simulation object title, simulation object function and simulation object remarks Explanation;Simulation object initialization information collection, for describing the initialization information of simulation object, including it is simulation object property set, imitative The event set of true computation model initiation parameter collection and simulation object initial schedule;Simulation object event information collection, for describing The information for all events for including in simulation object, including event title, Event Function, input parameter set, local variable collection, tune It spends Simulation Calculation collection, scheduling simulation object event collection, cancel simulation object event set;Input/output end port information collection is used In describing the simulation object input/output port information that includes, including port name, port type (input port/output end Mouthful), with the event title of port association.
As a further improvement of the present invention: the specific steps of the step (2) are as follows:
(2.1) Simulation Calculation chained list is created, and initializes Simulation Calculation chained list;
(2.2) judge whether Simulation Calculation resource folder is sky, if it is empty, then turns (2.6), otherwise turns (2.3);
(2.3) the computation model file in Simulation Calculation resource folder is successively chosen;
(2.4) Simulation Calculation parsed in Simulation Calculation resource folder describes file, by simulation calculation mould Type initiation parameter, input parameter, running parameter, output parameter information are stored in Simulation Calculation chained list, are counted for emulation It is used when calculating model visualization configuration;
(2.5) do you judge that all computation model files traverse to finish? if traversal finishes, turns (2.6), otherwise turn (2.3);
(2.6) Simulation Calculation resource panel is constructed;
(2.7) judge whether the Simulation Calculation in Simulation Calculation data link table is sky, is if it is empty then turned (2.11), otherwise turn (2.8);
(2.8) Simulation Calculation in Simulation Calculation chained list is successively chosen;
(2.9) the corresponding pel of the Simulation Calculation is loaded on Simulation Calculation resource panel;
(2.10) judge whether Simulation Calculation chained list traverses to finish, if traversal finishes, turn (2.11), otherwise turn (2.8);
(2.11) Simulation Calculation resource management module building is completed, and terminates to exit.
As a further improvement of the present invention: in the step (3), selection is indicated using different graphics shapes or picture It initializes pel, event pel, event scheduling pel, event and cancels pel, input/output end port pel, and automatically will be first Beginningization pel, event pel, event scheduling pel, event cancel pel, input/output end port pel is loaded into simulation object function It can assemble on panel, provide necessary functional assembly pel for simulation object visual assembly.
As a further improvement of the present invention: the specific steps of the step (3) are as follows:
(3.1) simulation object functional assembly pel panel is constructed;
(3.2) the load initialization pel on simulation object functional assembly pel panel;
(3.3) judge to initialize whether pel loads success, if loaded successfully, turn (3.4), otherwise turn (3.12);
(3.4) the load events pel on simulation object functional assembly pel panel;
(3.5) judge whether event pel loads success, if loaded successfully, turn (3.6), otherwise turn (3.12);
(3.6) load events dispatch pel on simulation object functional assembly pel panel;
(3.7) judge whether event scheduling pel loads success, if loaded successfully, turn (3.8), otherwise turn (3.12);
(3.8) load events cancel pel on simulation object functional assembly pel panel;
(3.9) judge that event cancels whether pel loads success, if loaded successfully, turns (3.10), otherwise turns (3.12);
(3.10) input/output end port pel is loaded on simulation object functional assembly pel panel;
(3.11) judge whether input/output end port pel loads success, if loaded successfully, turn (3.13), otherwise Turn (3.12)
(3.12) prompt emulation pel load failure, terminates to exit;
(3.13) simulation object functional assembly pel panel building is completed, and terminates to exit.
As a further improvement of the present invention: the specific steps of the step (4) are as follows:
(4.1) simulation object flow of event the visual design panel is constructed;
(4.2) incident visualization configured board is constructed;
(4.3) Simulation Calculation visual configuration panel is constructed;
(4.4) initialization function visual configuration panel is constructed;
(4.5) input/output end port information visualization configured board is constructed;
(4.6) event scheduling visual configuration panel is constructed;
(4.7) building event cancels visual configuration panel.
As a further improvement of the present invention: the specific steps of the step (5) are as follows:
(5.1) data structure of storage simulation object information is established;
(5.2) the visualization pel of composition simulation object is selected in simulation object visual assembly panel;
(5.3) do you judge that the pel belongs to initialization pel? if it is initialization pel, then turns (5.4), otherwise turn (5.5);
(5.4) configured simulation object initialization information is stored in simulation object data structure;
(5.5) do you judge that the pel belongs to input/output end port pel? if it is input/output end port pel, then turn (5.6), otherwise turn (5.7);
(5.6) configured input/output end port information is stored in simulation object data structure;
(5.7) judge whether the pel belongs to event pel, if it is event pel, then turn (5.8), otherwise turn (5.14);
(5.8) configured event information is stored in simulation object data structure;
(5.9) enter the corresponding Simulation Calculation configured board of the event
(5.10) the Simulation Calculation pel in the Simulation Calculation configured board is chosen;
(5.11) the Simulation Calculation configuration information that the event includes is added in simulation object data structure;
(5.12) judge whether the Simulation Calculation pel in Simulation Calculation configured board traverses to finish, if time It goes through and finishes, then turn (5.13), otherwise turn (5.10);
(5.13) Simulation Calculation configured board is exited, simulation object visual assembly panel is returned to, is turned (5.20);
(5.14) judge whether event scheduling pel then turns (5.15), otherwise turn the pel if it is event scheduling pel (5.17)
(5.15) source event (source of event scheduling pel) being connected with the event scheduling pel is searched for;
(5.16) the event scheduling configuration information that the source event includes is added in simulation object data structure;
(5.17) judge that whether event cancels scheduling pel to the pel, cancels scheduling pel if it is event, then turns (5.18), otherwise turn (5.20);
(5.18) it searches for and cancels the source event (source of event cancellation pel) that pel is connected with the event;
(5.19) event that the source event includes is added in simulation object data structure cancels configuration information;
(5.20) do you judge in simulation object visual assembly panel that all pels traverse to finish? if it is, turning (5.19), otherwise turn (5.2);
(5.21) simulation object data structure write-in simulation object is described into file, terminates to exit.
Compared with the prior art, the advantages of the present invention are as follows:
The present invention realizes a simulation object visual development environment using port visualization encapsulation simulation object.Make When with the visual development environment construction simulation object, existing emulation in the visual development environment can make full use of Computation model visual assembly simulation object, the Parallel Discrete Event Simulations technical details such as shielding parallel processing, event scheduling, drop The exploitation threshold of low simulation object, improves the development efficiency of simulation object.The present invention can be realized using the method for port encapsulation Separation between simulation object, meets simulation object distribution stand-alone development and zero modification in different Simulation Applications reuses.
Detailed description of the invention
Fig. 1 is the principle schematic diagram based on complication system Simulation Application composition.
Fig. 2 is the flow diagram of the method for the present invention.
Fig. 3 is that Simulation Calculation describes the file information meta-model schematic diagram in the present invention.
Fig. 4 is that Simulation Calculation resource management module constructs flow diagram in the present invention.
Fig. 5 is the building flow diagram of simulation object functional assembly pel panel in the present invention.
Fig. 6 is the building flow diagram of simulation object visual assembly module in the present invention.
Fig. 7 is the flow diagram that simulation object describes file automatic generating calculation in the present invention.
Fig. 8 is shown using visual assembly based on port encapsulation of the method for the present invention in a specific application example It is intended to.
Fig. 9 is using Simulation Calculation configuration schematic diagram of the method for the present invention in a specific application example.
Specific embodiment
The present invention is described in further details below with reference to Figure of description and specific embodiment.
As shown in Fig. 2, the simulation object visual development environment implementation method of the invention based on port encapsulation, step Are as follows:
(1) configuration simulation object describes file content;What determination must configure during visual assembly simulation object Information describes the content of file as simulation object, and then constitutes the meta-model that simulation object describes file;It includes emulation pair As essential information collection, simulation object initialization information collection, simulation object event information collection, input/output end port information collection.Referring to Fig. 3, concrete composition are as follows:
Simulation object essential information collection, for describing the essential information of simulation object, including simulation object title, emulation pair As function and simulation object remarks explanation.
Simulation object initialization information collection, for describing the initialization information of simulation object, including simulation object property set, The event set of Simulation Calculation initiation parameter collection and simulation object initial schedule.Simulation object property set, for describing this Simulation object needs to assign all properties information of initial value, including Property Name, attribute type and attribute in initialization function Explanation.Simulation Calculation initiation parameter collection needs to assign initial value for describing the simulation object in initialization function The initiation parameter information of all Simulation Calculations, including parameter name, parameter type and parameter declaration.Simulation object is initial The event set of scheduling, the simulation object event dispatched in initialization function for describing the simulation object, including scheduled thing The title of part, the time of event scheduling, event scheduling input parameter set.Wherein, the input parameter set of event scheduling, for retouching The input parameter sets that scheduling events pass to scheduled event are stated, each parameter includes parameter name, parameter type and ginseng It scolds bright.
Simulation object event information collection, the information of all events for describing to include in simulation object, including event name Title, input parameter set, local variable collection, scheduling simulation computation model collection, scheduling simulation object event collection, is cancelled Event Function Simulation object event set.Parameter set is inputted, it is each for describing the input parameter sets of the corresponding event handling function of the event The description of a input parameter includes parameter name, parameter type and parameter declaration.Local variable collection, it is corresponding for describing the event Event handling function in include local variable set, the description of each local variable includes name variable, types of variables And variable declaration.Scheduling simulation computation model collection, it is all imitative for describe to include in the corresponding event handling function of the event The successive execution relationship of true computation model and Simulation Calculation, execution serial number, simulation calculation mould including Simulation Calculation Type class name, Simulation Calculation instance name, Simulation Calculation input parameter set, Simulation Calculation running parameter collection, Simulation Calculation output parameter set.Simulation Calculation inputs parameter set, for describing needed for Simulation Calculation execution The input parameter sets wanted, each input parameter description includes parameter name, parameter type and parameter declaration.Simulation calculation mould Type running parameter collection, for describing running parameter set required for the Simulation Calculation executes, each running parameter is retouched It states including parameter name, parameter type and parameter declaration.Simulation Calculation output parameter set describes the Simulation Calculation and holds Output parameter set required for row, the description of each output parameter include parameter name, parameter type and parameter declaration.Scheduling Simulation object event set, other events inside simulation object for describing the simulation object event scheduling, including it is scheduled The title of event, the simulation time of event scheduling, event scheduling input parameter set.The input parameter set of event scheduling, is used for The input parameter sets that the simulation object event passes to scheduled event are described, each input parameter description includes parameter name Title, parameter type and parameter declaration.Cancel simulation object event set, cancels scheduled emulation for describing the event Other events inside object, the simulation time that event title, event including being cancelled are cancelled.
Input/output end port information collection, the input/output end port information aggregate for including for describing the simulation object, packet Include port name, port type (input port/output port), the event title with port association.
(2) Simulation Calculation resource management module is constructed, it is automatic to traverse Simulation Calculation resource folder, it will emulate Computation model imports Simulation Calculation management module, and simulation calculation mould is loaded on Simulation Calculation resource management panel Type pel;Simulation Calculation pel is a kind of graph-based mode of Simulation Calculation, such as indicates imitative with square True computation model pel.In specific operation process, can support using mouse to Simulation Calculation pel carry out selection with Drag operation provides necessary Simulation Calculation resource for simulation object visual assembly.As shown in figure 4, in concrete application In example, detailed step are as follows:
(2.1) Simulation Calculation chained list is created, and initializes Simulation Calculation chained list;
(2.2) judge whether Simulation Calculation resource folder is sky, if it is empty, then turns (2.6), otherwise turns (2.3);
(2.3) the computation model file in Simulation Calculation resource folder is successively chosen;
(2.4) Simulation Calculation parsed in Simulation Calculation resource folder describes file, by simulation calculation mould Type initiation parameter, input parameter, running parameter, output parameter information are stored in Simulation Calculation chained list, are counted for emulation It is used when calculating model visualization configuration;
(2.5) do you judge that all computation model files traverse to finish? if traversal finishes, turns (2.6), otherwise turn (2.3);
(2.6) Simulation Calculation resource panel is constructed;
(2.7) judge whether the Simulation Calculation in Simulation Calculation data link table is sky, is if it is empty then turned (2.11), otherwise turn (2.8);
(2.8) Simulation Calculation in Simulation Calculation chained list is successively chosen;
(2.9) the corresponding pel of the Simulation Calculation is loaded on Simulation Calculation resource panel;
(2.10) judge whether Simulation Calculation chained list traverses to finish, if traversal finishes, turn (2.11), otherwise turn (2.8);
(2.11) Simulation Calculation resource management module building is completed, and terminates to exit.
(3) simulation object functional assembly pel panel is constructed, pel, event pel, event scheduling pel, thing will be initialized Part cancels pel, input/output end port pel is loaded into simulation object functional assembly pel panel.In specific application example, Can choose indicates that initialization pel, event pel, event scheduling pel, event are cancelled using different graphics shapes or picture Pel, input/output end port pel, and automatically will initialization pel, event pel, event scheduling pel, event cancellation figure Member, input/output end port pel are loaded on simulation object functional assembly panel, provide necessity for simulation object visual assembly Functional assembly pel.As shown in figure 5, in specific application example, detailed process are as follows:
(3.1) simulation object functional assembly pel panel is constructed;
(3.2) the load initialization pel on simulation object functional assembly pel panel;
(3.3) judge to initialize whether pel loads success, if loaded successfully, turn (3.4), otherwise turn (3.12);
(3.4) the load events pel on simulation object functional assembly pel panel;
(3.5) judge whether event pel loads success, if loaded successfully, turn (3.6), otherwise turn (3.12);
(3.6) load events dispatch pel on simulation object functional assembly pel panel;
(3.7) judge whether event scheduling pel loads success, if loaded successfully, turn (3.8), otherwise turn (3.12);
(3.8) load events cancel pel on simulation object functional assembly pel panel;
(3.9) judge that event cancels whether pel loads success, if loaded successfully, turns (3.10), otherwise turns (3.12);
(3.10) input/output end port pel is loaded on simulation object functional assembly pel panel;
(3.11) judge whether input/output end port pel loads success, if loaded successfully, turn (3.13), otherwise Turn (3.12)
(3.12) prompt emulation pel load failure, terminates to exit;
(3.13) simulation object functional assembly pel panel building is completed, and terminates to exit.
In above process, initialization pel is a kind of graph-based mode of simulation object initialization process logic, Such as initialization pel is indicated with ellipse;Event pel is a kind of graph-based side of simulation object event handling logic Formula, such as event pel is indicated with circle;Event scheduling pel is a kind of graph-based mode of event scheduling logic, such as Event scheduling pel is indicated with unidirectional solid line with the arrow;It is a kind of graph-based that event cancels logic that event, which cancels pel, Mode, such as indicate that event cancels pel with unidirectional dotted line with the arrow;Input/output end port pel is handed between simulation object A kind of graph-based mode in mutual channel, such as input/output end port pel is indicated with triangle.
(4) the simulation object visual assembly module based on port encapsulation is constructed, successively realizes the submodule for forming the module Block, including simulation object flow of event visual configuration panel, simulation object incident visualization configured board, Simulation Calculation can It can depending on changing configured board, initialization function visual configuration panel, input/output end port visual configuration panel, event scheduling Depending on changing configured board, event cancels visual configuration panel.Simulation Calculation refers to simulated system, process or function Computer program is realized;Simulation object refers to that the computer program for simulating complication system entity behavior is realized.Simulation object Event (or abbreviation event) refers to be generated by a simulation object (source simulation object), passes to another simulation object (target Simulation object) data;After certain simulation time delay, target simulator object will locate accordingly data Reason.As shown in fig. 6, in specific application example, detailed process are as follows:
(4.1) simulation object flow of event visual configuration panel is constructed.The panel supports side of the user by mouse drag Formula will initialize pel, event pel, event scheduling pel, event cancellation pel, input/output end port pel and be loaded into emulation On object event stream visual edit panel;It supports to establish initialization pel and event pel, event using event scheduling pel Incidence relation between pel and event pel, event pel and port pel;Support that cancelling pel using event establishes event Incidence relation between pel and event pel, event pel and port pel.Emulation meter is indicated by using visualization pel It calculates model and simulation object initialization logic, event handling logic, event scheduling logic, event cancel logic and simulation object is handed over Mutual channel, to support the visual assembly of simulation object.By using port visable representation simulation object and external emulation Interaction channel between object, the interactive relation between decoupling simulation object, so as to realize the distribution of simulation object Stand-alone development.
(4.2) incident visualization configured board is constructed, which supports to event title, function description and event input ginseng Several configurations.It supports to enter the corresponding Simulation Calculation visual configuration panel of the simulated events by double click event pel.
(4.3) Simulation Calculation visual configuration panel is constructed, is supported through mouse drag to Simulation Calculation figure Member is loaded;It supports to construct the scheduling relationship between Simulation Calculation pel by way of mouse line;It supports to imitative The visual configuration of true computation model scheduling information.The panel is realized by assembling Simulation Calculation to event handling logic Visual development.
(4.4) initialization function visual configuration panel is constructed, supports to pop up simulation object by double-clicking initialization pel Initialization function visual configuration panel supports the visual configuration to simulation object initialization information.The panel is realized to imitative The visual development of true object initialization processing logic.
(4.5) input/output end port visual configuration panel is constructed, is supported by double-clicking input/output end port pel bullet Input/output end port visual configuration panel out is supported to configure input/output end port information visuallization.The panel is realized To the visual development of simulation object interaction channel.
(4.6) event scheduling visual configuration panel is constructed, supports to pop up event by double click event scheduling pel Dispatching visualization configured board supports the visual configuration to events scheduling information.The panel is realized to simulation object event tune Spend the visual development of logic.
(4.7) building event cancels visual configuration panel, supports that cancelling pel by double click event pops up event Cancel visual configuration panel, supports to cancel event information visuallization configuration.Panel realization takes simulation object event The visual development for the logic that disappears.
In above process, event handling refers to that the execution of event handling function, the processing of event can change simulation object State.(each event maps an event handling function one by one);Event scheduling is by simulation object (source simulation object) The event of generation passes to the activity of target simulator object.Event cancellation is to cancel the thing before event handling function execution The execution of part processing function.
(5) building simulation object describes file automatically-generating module, realizes that simulation object describes the calculation that file automatically generates The visual simulating object information constructed using port encapsulation mode is stored to simulation object and is described in file, then led to by method It crosses to reuse the simulation object and describe file and realizes reuse of the simulation object between different Simulation Applications.Port encapsulation of the invention Refer to and establishes the event interacted with other simulation objects by the way of port encapsulation during simulation object visual assembly Phone channel, so that simulation object becomes the entity of a stand-alone development, to support the stand-alone development of simulation object.Meanwhile Information exchange is realized by port interconnection between simulation object, in different Simulation Application scenes, the same simulation object can Different Simulation Application systems are constructed by port interconnection between other different simulation objects, to realize the same simulation object Reuse in different Simulation Applications.As shown in fig. 7, in specific application example, detailed process are as follows:
(5.1) data structure of storage simulation object information is established;
(5.2) the visualization pel of composition simulation object is selected in simulation object visual assembly panel;
(5.3) do you judge that the pel belongs to initialization pel? if it is initialization pel, then turns (5.4), otherwise turn (5.5);
(5.4) configured simulation object initialization information is stored in simulation object data structure;
(5.5) do you judge that the pel belongs to input/output end port pel? if it is input/output end port pel, then turn (5.6), otherwise turn (5.7);
(5.6) configured input/output end port information is stored in simulation object data structure;
(5.7) judge whether the pel belongs to event pel, if it is event pel, then turn (5.8), otherwise turn (5.14);
(5.8) configured event information is stored in simulation object data structure;
(5.9) enter the corresponding Simulation Calculation configured board of the event
(5.10) the Simulation Calculation pel in the Simulation Calculation configured board is chosen;
(5.11) the Simulation Calculation configuration information that the event includes is added in simulation object data structure;
(5.12) judge whether the Simulation Calculation pel in Simulation Calculation configured board traverses to finish, if time It goes through and finishes, then turn (5.13), otherwise turn (5.10);
(5.13) Simulation Calculation configured board is exited, simulation object visual assembly panel is returned to, is turned (5.20);
(5.14) judge whether event scheduling pel then turns (5.15), otherwise turn the pel if it is event scheduling pel (5.17)
(5.15) source event (source of event scheduling pel) being connected with the event scheduling pel is searched for;
(5.16) the event scheduling configuration information that the source event includes is added in simulation object data structure;
(5.17) judge that whether event cancels scheduling pel to the pel, cancels scheduling pel if it is event, then turns (5.18), otherwise turn (5.20);
(5.18) it searches for and cancels the source event (source of event cancellation pel) that pel is connected with the event;
(5.19) event that the source event includes is added in simulation object data structure cancels configuration information;
(5.20) do you judge in simulation object visual assembly panel that all pels traverse to finish? if it is, turning (5.19), otherwise turn (5.2);
(5.21) simulation object data structure write-in simulation object is described into file, terminates to exit.
The present invention is exactly based on above-mentioned steps (1)~(5), realizes the simulation object visual development based on port encapsulation Environment.In above process, the present invention indicates that Simulation Calculation and simulation object initialization are patrolled by using visualization pel It collects, event handling logic, event scheduling logic, event are cancelled logic and simulation object interaction channel, and further realized to phase The visual configuration of pel is answered, to support the visual assembly of simulation object.The present invention is by using port visable representation Interaction channel between simulation object and other simulation objects, the interactive relation between decoupling simulation object, so as to reality The distributed stand-alone development of existing simulation object, while also making place mat for reuse of the simulation object in different Simulation Applications.
For the concrete application that the present invention is further explained, the present invention is done into one with specific application example below Walk explanation.For example, trailer-mounted radar is a kind of relative distance, relative velocity and relative bearing by measuring main vehicle and target carriage Information, and these parameters are passed into source of early warning and the braking system of main vehicle with the device for the generation that tries to forestall traffic accidents.By In attention of the people to traffic safety, trailer-mounted radar has become the development hot spot of various countries.By constructing trailer-mounted radar simulation object And it is a kind of important channel for developing trailer-mounted radar relevant parameter that analysis of simulation experiment is carried out to it.
Underneath with the simulation object visual development environment construction trailer-mounted radar simulation object realized based on the present invention.
(1) Simulation Calculation resource management module is constructed, imports echo-signal Filtering Model, analog-to-digital conversion calculates mould Type, echo signal processing model resource, and echo-signal Filtering Model pel, mould are loaded on Simulation Calculation resource panel Number conversion computation model pel, echo signal processing model pel, as shown in Fig. 8 left module.
(2) simulation object functional assembly pel panel, the simulation object that load visual assembly simulation object needs are constructed Functional assembly pel, including initialization pel, event pel, event scheduling pel, event cancel pel, input/output end port Pel etc., on the upside of Fig. 8 shown in module.
(3) simulation object visual assembly module is constructed, the initial of initialization pel visable representation simulation object is used Change processing logic to visualize using event pel visable representation simulation object event handling logic using event scheduling pel It indicates the scheduling relationship between simulation object internal event, indicates that simulation object is imitated with other using input/output end port pel Interaction channel between true object.As shown in Fig. 8 right module, trailer-mounted radar simulation object include pulse signal transmitting event, Echo-signal calculates event, echo signal processing event.The simulation object dispatches pulse signal transmitting thing in initialization function Part, and interacted by output port 1 with other simulation objects (target carriage).Input port 1 receives other simulation object (mesh Mark vehicle) information and transfer to respectively echo-signal calculate event handling, calculated result is sent to echo signal processing event later It is handled, is then carried out by output port 2 and output port 3 and other simulation objects (such as source of early warning, braking system) Interaction.By double click echo signal processing event pel, Simulation Calculation configuration circle as shown in Figure 9 can be constructed Face constructs echo letter by configuring echo-signal Filtering Model, analog-to-digital conversion computation model, echo signal processing algorithm model Number corresponding event handling logic of processing event.The present invention visually realizes the visualization of simulation object by using visualization pel Assembling, to improve the development efficiency of simulation object;Meanwhile Simulation Calculation is packaged using port pel, it can be with It is decoupling between realization simulation object, to support the distributed stand-alone development of simulation object.
(4) realize that simulation object describes file automatic generating calculation, for will be based on the visual simulating pair of port encapsulation Image information automatically writes simulation object and describes file, and it is as shown in Figure 3 that the simulation object of generation describes file content.Due to using end The mode of mouthful encapsulation realize it is decoupling between simulation object, therefore, by reuse the simulation object describe file realize it is imitative Reuse of the true object between different Simulation Applications.
The above is only the preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-described embodiment, All technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art For those of ordinary skill, several improvements and modifications without departing from the principles of the present invention should be regarded as protection of the invention Range.

Claims (7)

1. a kind of simulation object visual development environment implementation method based on port encapsulation, which is characterized in that step are as follows:
(1) configuration simulation object describes file content, determines the information that must be configured during visual assembly simulation object, The content of file is described as simulation object, and then constitutes the meta-model that simulation object describes file;
(2) Simulation Calculation resource management module is constructed, it is automatic to traverse Simulation Calculation resource folder, by simulation calculation Model imports Simulation Calculation management module, and Simulation Calculation pel is loaded into Simulation Calculation resource management face On plate;
(3) simulation object functional assembly pel panel is constructed, initialization pel, event pel, event scheduling pel, event are taken Disappear pel, input/output end port pel is loaded on simulation object functional assembly pel panel;
(4) the simulation object visual assembly module based on port encapsulation is constructed, successively realizes the submodule for forming the module, packet Include simulation object flow of event visual configuration panel, simulation object incident visualization configured board, Simulation Calculation visualization Configured board, initialization function visual configuration panel, input/output end port visual configuration panel, event scheduling visualization Configured board, event cancel visual configuration panel;The Simulation Calculation visual configuration panel support is dragged by mouse It drags and Simulation Calculation pel is loaded;
(5) building simulation object describes file automatically-generating module, realizes that simulation object describes file automatic generating calculation, will adopt The visual simulating object information storage constructed with port encapsulation mode describes in file to simulation object, is then somebody's turn to do by reusing Simulation object describes file and realizes reuse of the simulation object between different Simulation Applications;
In above process, Simulation Calculation and simulation object initialization logic, event are indicated by using visualization pel It handles logic, event scheduling logic, event and cancels logic and simulation object interaction channel, and realize the visualization to corresponding pel Configuration, to support the visual assembly of simulation object;By using port visable representation simulation object and other simulation objects Between interaction channel, the interactive relation between decoupling simulation object realizes the distributed stand-alone development of simulation object, and Reuse of the simulation object in different Simulation Applications.
2. the simulation object visual development environment implementation method according to claim 1 based on port encapsulation, feature Be, the simulation object describe file meta-model include simulation object essential information collection, simulation object initialization information collection, Simulation object event information collection, input/output end port information collection;The simulation object essential information collection, for describing emulation pair The essential information of elephant, including simulation object title, simulation object function and simulation object remarks explanation;The simulation object is initial Change information collection, for describing the initialization information of simulation object, including simulation object property set, Simulation Calculation initialization ginseng The event set of manifold and simulation object initial schedule;The simulation object event information collection includes in simulation object for describing Event information, including event title, Event Function, input parameter set, local variable collection, scheduling simulation computation model collection, adjust It spends simulation object event set, cancel simulation object event set;The input/output end port information collection, for describing the emulation pair As comprising input/output port information, including port name, port type, with the event title of port association.
3. the simulation object visual development environment implementation method according to claim 1 or 2 based on port encapsulation, special Sign is, the specific steps of the step (2) are as follows:
(2.1) Simulation Calculation chained list is created, and initializes Simulation Calculation chained list;
(2.2) judge whether Simulation Calculation resource folder is sky, if it is empty, then turns (2.6), otherwise turns (2.3);
(2.3) the computation model file in Simulation Calculation resource folder is successively chosen;
(2.4) Simulation Calculation parsed in Simulation Calculation resource folder describes file, will be at the beginning of Simulation Calculation Beginningization parameter, input parameter, running parameter, output parameter information are stored in Simulation Calculation chained list, for simulation calculation mould It is used when type visual configuration;
(2.5) do you judge that all computation model files traverse to finish? if traversal finishes, turns (2.6), otherwise turn (2.3);
(2.6) Simulation Calculation resource panel is constructed;
(2.7) judge whether the Simulation Calculation in Simulation Calculation data link table is sky, is if it is empty then turned (2.11), it is no Then turn (2.8);
(2.8) Simulation Calculation in Simulation Calculation chained list is successively chosen;
(2.9) the corresponding pel of the Simulation Calculation is loaded on Simulation Calculation resource panel;
(2.10) judge whether Simulation Calculation chained list traverses to finish, if traversal finishes, turn (2.11), otherwise turn (2.8);
(2.11) Simulation Calculation resource management module building is completed, and terminates to exit.
4. the simulation object visual development environment implementation method according to claim 1 or 2 based on port encapsulation, special Sign is, in the step (3), selection indicates initialization pel, event pel, event using different graphics shapes or picture Pel, event cancellation pel, input/output end port pel are dispatched, and pel, event pel, event tune will be initialized automatically Degree pel, event cancel pel, input/output end port pel is loaded on simulation object functional assembly panel, are simulation object Visual assembly provides functional assembly pel.
5. the simulation object visual development environment implementation method according to claim 4 based on port encapsulation, feature It is, the specific steps of the step (3) are as follows:
(3.1) simulation object functional assembly pel panel is constructed;
(3.2) the load initialization pel on simulation object functional assembly pel panel;
(3.3) judge to initialize whether pel loads success, if loaded successfully, turn (3.4), otherwise turn (3.12);
(3.4) the load events pel on simulation object functional assembly pel panel;
(3.5) judge whether event pel loads success, if loaded successfully, turn (3.6), otherwise turn (3.12);
(3.6) load events dispatch pel on simulation object functional assembly pel panel;
(3.7) judge whether event scheduling pel loads success, if loaded successfully, turn (3.8), otherwise turn (3.12);
(3.8) load events cancel pel on simulation object functional assembly pel panel;
(3.9) judge that event cancels whether pel loads success, if loaded successfully, turns (3.10), otherwise turns (3.12);
(3.10) input/output end port pel is loaded on simulation object functional assembly pel panel;
(3.11) judge whether input/output end port pel loads success, if loaded successfully, turn (3.13), otherwise turn (3.12)
(3.12) prompt emulation pel load failure, terminates to exit;
(3.13) simulation object functional assembly pel panel building is completed, and terminates to exit.
6. the simulation object visual development environment implementation method according to claim 1 or 2 based on port encapsulation, special Sign is, the specific steps of the step (4) are as follows:
(4.1) simulation object flow of event the visual design panel is constructed;
(4.2) incident visualization configured board is constructed;
(4.3) Simulation Calculation visual configuration panel is constructed;
(4.4) initialization function visual configuration panel is constructed;
(4.5) input/output end port information visualization configured board is constructed;
(4.6) event scheduling visual configuration panel is constructed;
(4.7) building event cancels visual configuration panel.
7. the simulation object visual development environment implementation method according to claim 1 or 2 based on port encapsulation, special Sign is, the specific steps of the step (5) are as follows:
(5.1) data structure of storage simulation object information is established;
(5.2) the visualization pel of composition simulation object is selected in simulation object visual assembly panel;
(5.3) do you judge that the pel belongs to initialization pel? if it is initialization pel, then turns (5.4), otherwise turn (5.5);
(5.4) configured simulation object initialization information is stored in simulation object data structure;
(5.5) do you judge that the pel belongs to input/output end port pel? if it is input/output end port pel, then turn (5.6), otherwise turn (5.7);
(5.6) configured input/output end port information is stored in simulation object data structure;
(5.7) judge whether the pel belongs to event pel, if it is event pel, then turn (5.8), otherwise turn (5.14);
(5.8) configured event information is stored in simulation object data structure;
(5.9) enter the corresponding Simulation Calculation configured board of the event
(5.10) the Simulation Calculation pel in the Simulation Calculation configured board is chosen;
(5.11) the Simulation Calculation configuration information that the event includes is added in simulation object data structure;
(5.12) judge whether the Simulation Calculation pel in Simulation Calculation configured board traverses to finish, if traversed Finish, then turns (5.13), otherwise turn (5.10);
(5.13) Simulation Calculation configured board is exited, simulation object visual assembly panel is returned to, is turned (5.20);
(5.14) judge whether event scheduling pel then turns (5.15), otherwise turn the pel if it is event scheduling pel (5.17)
(5.15) source event being connected with the event scheduling pel is searched for;
(5.16) the event scheduling configuration information that the source event includes is added in simulation object data structure;
(5.17) judge that whether event cancels scheduling pel to the pel, cancels scheduling pel if it is event, then turns (5.18), it is no Then turn (5.20);
(5.18) it searches for and cancels the source event that pel is connected with the event;
(5.19) event that the source event includes is added in simulation object data structure cancels configuration information;
(5.20) do you judge in simulation object visual assembly panel that all pels traverse to finish? if it is, turn (5.21), Otherwise turn (5.2);
(5.21) simulation object data structure write-in simulation object is described into file, terminates to exit.
CN201410519285.XA 2014-09-30 2014-09-30 A kind of simulation object visual development environment implementation method based on port encapsulation Active CN104268002B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410519285.XA CN104268002B (en) 2014-09-30 2014-09-30 A kind of simulation object visual development environment implementation method based on port encapsulation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410519285.XA CN104268002B (en) 2014-09-30 2014-09-30 A kind of simulation object visual development environment implementation method based on port encapsulation

Publications (2)

Publication Number Publication Date
CN104268002A CN104268002A (en) 2015-01-07
CN104268002B true CN104268002B (en) 2019-02-01

Family

ID=52159526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410519285.XA Active CN104268002B (en) 2014-09-30 2014-09-30 A kind of simulation object visual development environment implementation method based on port encapsulation

Country Status (1)

Country Link
CN (1) CN104268002B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069205A (en) * 2015-07-24 2015-11-18 江苏省公用信息有限公司 Port encapsulation based method for realizing visualized development environment of simulation object
CN107220105A (en) * 2017-06-22 2017-09-29 中国人民解放军国防科学技术大学 Parallel Discrete Event Simulation system auto-initiation implementation method
EP3671492A1 (en) * 2018-12-21 2020-06-24 Dassault Systèmes Adaptive compression of simulation data for visualization
CN109684779A (en) * 2019-02-15 2019-04-26 湖南高至科技有限公司 A kind of simulation model assembly method based on view
CN110069876B (en) * 2019-04-29 2020-05-08 北京世冠金洋科技发展有限公司 Experiment management method and device
WO2021217657A1 (en) * 2020-04-30 2021-11-04 深圳中砼物联网科技有限公司 Software rapid development method, computer device, and storage medium
CN111881634B (en) * 2020-06-19 2023-09-08 成都天奥测控技术有限公司 Electronic system behavior level simulation verification method
CN112465344B (en) * 2020-11-26 2023-10-24 中船重工鹏力(南京)智能装备系统有限公司 Initialization method based on workshop automatic production line simulation system parameters
CN112464381B (en) * 2020-11-27 2023-04-07 中汽研汽车检验中心(天津)有限公司 Automatic simulation construction method for new energy vehicle performance
CN112860334A (en) * 2021-01-22 2021-05-28 中国人民解放军国防科技大学 Parallel simulation method and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546348A (en) * 2009-04-13 2009-09-30 苏州同元软控信息技术有限公司 Model base icon display method based on physical modeling language

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546348A (en) * 2009-04-13 2009-09-30 苏州同元软控信息技术有限公司 Model base icon display method based on physical modeling language

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Reusable Component Model Development Approach for Parallel and Distributed Simulation》;Feng Zhu等;《The Scientific World Journal》;20140331;第2014卷(第11期);全文
《基于组件的并行离散事件仿真应用开发技术研究》;周维贵;《中国优秀硕士学位论文全文数据库信息科技辑》;20111215;I138-1937

Also Published As

Publication number Publication date
CN104268002A (en) 2015-01-07

Similar Documents

Publication Publication Date Title
CN104268002B (en) A kind of simulation object visual development environment implementation method based on port encapsulation
Concepcion et al. DEVS formalism: A framework for hierarchical model development
CN103412975B (en) Dynamic traffic emulation platform and emulation mode thereof
CN104268346B (en) A kind of implementation method of the Simulation Application visualization the integration environment based on object class interaction figure
CN104915482A (en) Satellite data receiving simulation analysis platform
CN106789339A (en) A kind of distributed cloud emulation mode and system based on lightweight virtualization architecture
CN107942720A (en) A kind of online flight Simulation System of portable type ground
Cheng et al. A Petri net simulation model for virtual construction of earthmoving operations
CN103955373A (en) Design method of SDN (Software Defined Networking) application integration development environment
CN106096145B (en) A kind of complication system mathematics library and analysis system based on state space
CN102012673A (en) Design method of complex reaction type system controller
CN105843991B (en) Stage HLA simulated members combined system and method
Sung et al. Interoperation of DEVS models and differential equation models using HLA/RTI: hybrid simulation of engineering and engagement level models
CN113298911B (en) Graphical concept modeling method based on lambda rule
Sokolov et al. A flexible framework for developing integrated models of transportation systems using an agent-based approach
CN102081521A (en) General development platform of military hardware operation interface
Sohier et al. A tooled methodology for the system architect’s needs in simulation with autonomous driving application
Cárdenas et al. Asymmetric Cell-DEVS models with the Cadmium simulator
CN104933267A (en) Behavior logic modeling method of industrial electronic system
Lin et al. Top-level modeling theory of multi-discipline virtual prototype
Cheng et al. Multi-objective dynamic simulation-optimization for equipment allocation of earthmoving operations
Grether et al. Extensible software design of a multi-agent transport simulation
CN105022897A (en) Marine simulation engine supporting heterogeneous model integration and component reuse
CN104598663A (en) Virtual generating system and method for ocean mechanical environment
Geng Intelligent BIM building technology (BT) based on optimization algorithm

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant