设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14618|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 F3 p# `8 m  b( W! d

2 c. a/ L' w+ D我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 t% @8 z: _0 M/ t7 A

* k0 w1 `, H2 Z+ b4 Nbegin P_read arriving
7 {  `+ K' Y  D1 u& W    while 1=1 do begin9 T/ P$ [" n8 u% A3 t! M+ J" c
        read A_tote from "data.txt" with delimiter "\n"
/ o+ k1 E; N. z: @; E        read A_time from "data.txt" with delimiter "\n"8 X  C8 x) E. o* c! k, @
        read A_leave from "data.txt" with delimiter "\n"" S9 C6 ]' d# R) ~0 N3 Y1 o8 i
        read A_picks from "data.txt" with delimiter "\n"
; M6 @' g5 y+ w* M        set load type to A_tote
: r+ @3 ]- J+ e" q* K4 q        if A_tote="tote 1" then set A_induct to 11 f& A$ a6 Q8 N' M3 v
        else if A_tote="tote 2" then set A_induct to 2
! ]. K5 x6 U: B, r            else set A_induct to 3    $ c0 q+ H6 F9 v7 S+ j
        set A_i to 06 U8 ^3 v& N. r
        clone 1 load to P_induction
0 R( |5 h: a2 S$ _; k        wait for A_time sec
9 O9 V8 g% E( j$ \3 v' m4 L    end
* l* x: j& S4 r* c- u0 w  Cend2 ]" O' A* m' C  E' B  d
3 X+ Z/ {/ n' g; W' Z$ s
begin P_induction arriving) X% Z, C2 G7 A  H6 j
    if A_induct=1 then clone 1 load to P_pick1, g8 s* x& n8 J
    else if A_induct=2 then clone 1 load to P_pick2/ R% {7 C  v% w! q* T
        else clone 1 load to P_pick34 j0 z3 K$ S6 G6 ?2 W% Y7 s
end1 X$ h- r! P* U) U9 f# s$ g) k: N
$ z4 h' ~1 V4 [& r* U: ?7 U* r
begin P_pick1 arriving. p/ h& G4 N, J1 A3 x
    set A_i to 1
& O* n* [! ~$ W" n, Y% ~. d    move into Q_induct1
# b. ~& _8 k3 R3 u* ?4 r    move into pickaisle.induct15 E, a! w! @1 R# R
    while A_i<=30 do begin
6 |! ?- R* C5 w+ g$ Q        travel to pickaisle.con(A_i)9 P7 @. ^8 V( S  u( }' H% Y  ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  m; R1 I& E/ M+ [8 J0 T        else wait for 10 sec2 }: H% f' m, A! P" z
        if A_i=A_leave then send to die
% j; d* f! m+ P9 l; |; c        else inc A_i by 1
* |8 z: a7 t3 v( q    end
: c, o( Z8 [; a5 z1 k5 fend
/ t0 M: e, J* ]' f4 I' j# |2 R$ T' Y  H3 V
begin P_pick2 arriving6 e% U- R, Q# t1 W. V
    set A_i to 111 x, ~; ~. c% j7 v! Z+ ~$ _
    move into Q_induct2! N! F% M, W# f7 x/ x
    move into pickaisle.induct21 Y( g" N# X" B9 b( \, `
    while A_i<=30 do begin
* C3 @8 b- O) ?7 b9 Y: R! P        travel to pickaisle.con(A_i)
# l) U. z- Z5 }- C5 W$ D- V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 J4 n( G: a* j4 }        else wait for 10 sec' u6 w! G( s% G; x
        if A_i=A_leave then send to die. s' r6 \2 [% }0 F$ M9 f
        else inc A_i by 14 X4 Q, h: f7 F% x" |% h
    end' [. s& [% X" U+ Q( |2 K
end% |  `+ ~: s4 N) T& h  ^2 a
: w. }' [$ l& ^) X! F( Y( F* b+ X
begin P_pick3 arriving, U# W! H5 _0 ]; R1 k
    set A_i to 210 d. U* \9 y3 H* m# K3 R. ~0 a
    move into Q_induct3
1 \# v  a4 a- K3 d    move into pickaisle.induct3
+ d1 i9 ^  A4 e* v0 q9 {; C6 j    while A_i<=30 do begin" J6 [, T/ o3 ]
        travel to pickaisle.con(A_i)* |! f  D; a! ]9 b! c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( G7 j" f7 G6 Y- z; v7 R        else wait for 10 sec
5 O5 w' k( t' y8 k        if A_i=A_leave then send to die
: F: E% b3 Q$ ~/ a# }: g+ s+ K        else inc A_i by 1
8 A: V& t. m1 }* c# t; i8 [3 C    end
& s0 R* ~% X7 W, M, p+ uend

最佳答案

查看完整内容

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是个什么东东?
3 H* @$ g( p% `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 ?9 s0 o5 d8 J# J3 c2 M- u% J! v) l& [4 T
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 t: q2 q5 V. P2 \' S

+ B5 l7 w2 \0 I/ E: [5 f另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:0 A2 n3 h* k# s# R# N9 a2 B
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 Q* I( d6 M* K
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' m% c, l  [' |% U, u1 n
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. a# |( _' @9 x4 k8 w
begin P_induction arriving
) P8 |9 p1 q- i0 o% ^# c  g, R    clone 1 load to P_pick(A_induct)
! `/ q* c1 _: G# `end最大的系
; s, L7 Z: d4 B. [) d  M. I, F$ m
begin P_pick arriving
! J3 _2 I7 J1 f: Q5 ^  ?    set A_i to procindex * 10 + 14 G/ a3 \- z: |# ]. T8 l
    move into Q_induct(procindex)
9 k( d  \: K& G+ {7 \    move into pickaisle.induct(procindex)7 v+ Y8 G! ^5 C7 ?) E- P! e
    /*check the type of pickaisle.induct(i), for your last problem.*/9 Q3 D$ c7 j# P7 X

! }6 r, ?( H1 M8 z: A6 d8 w* d    while A_i<=30 do begin
- b, r$ b. g3 \* |( J        travel to pickaisle.con(A_i)
4 Q. t% ~4 e* ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* T5 U9 G. b0 Y. }9 P$ U        else wait for 10 sec
6 e" a. t8 G, o4 y1 l1 G* _1 F& y& W        if A_i=A_leave then send to die/ _1 Y% j( }. \# l" z) j2 T3 E$ n; Y
        else inc A_i by 1
: E2 C+ f' D6 b    end* [% ]/ Z" {5 |, E
end
8 u  f3 H$ D3 L' P, }3 |/ O6 a, K1 B
其中的procindex为整形,代表当前process的序号。& {  h- a& K$ O- v0 O
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-7-18 17:18 , Processed in 0.015875 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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