设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15152|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 g% q0 `; ?0 e' M
4 R: _4 x. A, Q# A8 m4 ]
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
/ s0 W' w% \8 r* P0 i8 k  i+ G( R1 K3 t' ^
begin P_read arriving
1 [4 T! r" _- i, j    while 1=1 do begin
( E0 R1 L9 l4 b- L1 j        read A_tote from "data.txt" with delimiter "\n"
/ m0 Q. d5 e: I# D4 H% }        read A_time from "data.txt" with delimiter "\n"( L/ E" \; m3 y) L8 m$ w  T
        read A_leave from "data.txt" with delimiter "\n"
& t0 A- [8 ]0 s. F6 P) `/ F9 {        read A_picks from "data.txt" with delimiter "\n"
5 G3 X" s5 N5 E8 \7 Y; C. ]        set load type to A_tote; X/ B; b1 d& o+ b; v' q
        if A_tote="tote 1" then set A_induct to 1
: z) L  [; o# v1 b: F        else if A_tote="tote 2" then set A_induct to 2$ i7 ~& s+ X: o; E8 E4 f
            else set A_induct to 3    2 f* R1 T# A: r: r1 A4 V
        set A_i to 05 U* S3 W4 g# J8 |4 `
        clone 1 load to P_induction
; a. N# T* J$ n# ~4 C        wait for A_time sec
2 M+ H1 E3 a% E, S0 E) ]1 Y7 r    end
- P3 i* e% @, V( z2 U9 q* d" I! bend
& ]3 ^4 P9 D! x0 Z0 I- S% X
1 ]; J5 B5 E, ^% P% \- q# r# Mbegin P_induction arriving
2 t& H) B& g1 N# t- D6 D4 t    if A_induct=1 then clone 1 load to P_pick1
" ^+ A8 v9 ^( M( `    else if A_induct=2 then clone 1 load to P_pick2- O1 N' }& @& M& z3 v4 C2 D
        else clone 1 load to P_pick37 H4 z5 O7 A! e; K2 c$ k* ]7 M
end$ }3 M$ a% e- ^7 C
" @& C5 m6 O+ v" W. w+ X
begin P_pick1 arriving7 q+ u" o* s: I( f; U
    set A_i to 1- @" ]4 j4 q0 C
    move into Q_induct1+ O/ J" ^* o2 x( S
    move into pickaisle.induct1
% D: {4 ?/ K1 ~3 b" K- l, k    while A_i<=30 do begin) K/ h8 B* R) h! d1 @
        travel to pickaisle.con(A_i)
0 P9 h* E9 V$ |; v6 K0 y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 l+ u; j8 s; f8 o) j& {
        else wait for 10 sec
$ C& |8 C: r% P6 \: M# d8 Q        if A_i=A_leave then send to die+ v' c$ ^0 z5 \6 V
        else inc A_i by 1
  h5 I. D2 I) V* w* U8 I9 t! y    end1 Q: K/ m" D& I( @: V: w7 A
end
$ D5 Z0 M+ \* k- w: ]. S
  D. [2 A- v& o- \& |8 xbegin P_pick2 arriving
/ i9 _5 `' n8 x. o. D0 I    set A_i to 11
( Y7 r  E9 L4 @6 h$ i8 g! {    move into Q_induct23 ], a8 S: a1 g! Q
    move into pickaisle.induct2  O3 z! C2 Z! Q! o
    while A_i<=30 do begin
2 Q5 q, T* D1 b" G, a7 Y# N; F        travel to pickaisle.con(A_i)
" [4 a3 x; d# I) _% F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 h5 ]; l+ M% g, O$ t        else wait for 10 sec
0 w) {1 ~7 o+ s( a        if A_i=A_leave then send to die
& v& [/ e: B( q        else inc A_i by 1
* `; f9 [( t& R/ Y: i. s    end
3 O. T- c! S1 Q( Zend
4 I; Q  U. l- z* A( H- G  w1 ?& U6 S/ w& k$ V& I2 ^2 F
begin P_pick3 arriving
$ G2 w* U1 V! k( \4 H    set A_i to 21# s$ i2 K8 {, J6 _
    move into Q_induct3( J2 K& |( k4 f0 Q; K3 s9 e
    move into pickaisle.induct30 e" K$ G2 |0 W  a" w3 V) Z
    while A_i<=30 do begin
4 a% ^0 @$ u9 u        travel to pickaisle.con(A_i)
0 \+ W% _" M# {, f        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^  o8 B3 F! v' L
        else wait for 10 sec/ x/ q0 k2 w4 _8 q
        if A_i=A_leave then send to die% W. j& p3 C" Y0 r. f
        else inc A_i by 1, `5 Z+ e; n% i/ {5 b- s! G
    end  ?& [" g  K4 b
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
& k5 P' ?: T7 m& \1 smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?. b" m- }# y- h  [( P
2 N/ ~# T3 i$ o, F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
9 l* o: f# ^% p* q7 s; a
+ T) ?- ]3 R8 C9 H' E另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
2 a9 V7 {$ U9 v6 m. l7 }% y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;+ r# n  @  I& R  ~
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
9 ~5 t( C: c; j# F8 q3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
: K7 w5 q$ a  s) W, gbegin P_induction arriving
: J4 ^5 R; m  s' k" |, W2 J    clone 1 load to P_pick(A_induct), T4 i5 [& M3 H
end最大的系
, n7 V7 g( I$ I9 Z- q+ X* ^0 p: C5 q7 j9 E  \+ l
begin P_pick arriving
! }4 s! I$ d# Y& `, m    set A_i to procindex * 10 + 1
, P3 |4 ^& }# ?' D+ o2 `9 e    move into Q_induct(procindex)
- v( r# `+ d( z    move into pickaisle.induct(procindex)4 b  ?& j) w4 |% }9 |
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 W# @/ z, R* I0 Y' _0 W+ W: x9 r; Z
    while A_i<=30 do begin
' I4 ?# Q* r/ M5 B2 q: n        travel to pickaisle.con(A_i)1 O1 z% h$ D1 z9 _5 L# c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ^6 I8 [9 q' P- s. E8 V; I        else wait for 10 sec* ~$ j+ T/ y  I  p9 T! ^! [
        if A_i=A_leave then send to die, Q( g, W- |5 X. r  a& x7 x/ U
        else inc A_i by 1) C  f" M  R. I; K( @; K& m2 ~
    end
) l9 [+ d5 p1 C( z& z6 Y% _% eend6 l6 O2 Z/ C; A$ _: L; r& b+ Q

+ I" m! f- ^3 c. P3 D其中的procindex为整形,代表当前process的序号。  ^3 a- T, Y  n- O0 j( S' o; U
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-8-16 07:08 , Processed in 0.026800 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表