设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14601|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 V0 I5 j9 z6 J9 p" M' P" k

0 X$ {7 J  a+ [我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# _+ y. K9 }  o, f
, M: Y, N- D. c2 V; x; hbegin P_read arriving: j' C1 ~& L) P8 K2 @
    while 1=1 do begin) M! E/ c2 i* ^) h' L8 I0 x/ Y
        read A_tote from "data.txt" with delimiter "\n"
: b/ n& s& x& J+ p1 V        read A_time from "data.txt" with delimiter "\n"
: q. E4 v- B; Q7 }' [1 q        read A_leave from "data.txt" with delimiter "\n"! f7 R: O: ~3 U. W. }
        read A_picks from "data.txt" with delimiter "\n"
; k: p, ?4 Q. s. _        set load type to A_tote
* C: e; F' c  p! M* O        if A_tote="tote 1" then set A_induct to 16 H/ R. p2 N% c  q
        else if A_tote="tote 2" then set A_induct to 2$ g" Y1 b/ G) W# O3 B) p  f
            else set A_induct to 3    3 {2 B# y7 W; B, Q' f/ X3 I( k
        set A_i to 04 P: N& a# c9 X9 M* t$ \& a
        clone 1 load to P_induction
0 {. ?) L' B9 Z; l8 {! C% x+ X        wait for A_time sec& k2 a$ Z8 d( l" E# T% Q$ `
    end5 i7 I9 i; w7 r+ e
end
+ X0 b( q+ |% Y  Q9 }% {- P, M) |* _
begin P_induction arriving
& O2 T, h6 h: u4 a0 w. _* P    if A_induct=1 then clone 1 load to P_pick1
2 s% B1 T& P: G! g: Q2 n5 V  g- L: p7 T# q    else if A_induct=2 then clone 1 load to P_pick2
6 ^$ e5 l+ F( |1 Z        else clone 1 load to P_pick3
2 w3 }4 \0 _' @+ |- q4 {end
5 D1 }8 a: t8 C9 h, K/ W
7 K, x( t1 ~  Vbegin P_pick1 arriving
' L5 ?- C; i5 ^* A# L5 b: x    set A_i to 1: x! a+ @& h- L8 g8 ^8 T  h
    move into Q_induct1
1 r& B2 C% [" H! ]) h3 f" ^    move into pickaisle.induct1, |$ s1 t1 ^4 n0 X! N" j
    while A_i<=30 do begin1 r, a7 M- R4 X1 m9 u
        travel to pickaisle.con(A_i)- n, v/ L" y" d" q4 n7 Q5 c
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ j; E) E" p/ B  {0 a
        else wait for 10 sec
4 B4 ^3 K8 ]* R; u        if A_i=A_leave then send to die: ^/ E7 M* ]' @2 ~; j  g5 @$ G; t
        else inc A_i by 1
- T! E( m7 e6 ?1 v/ Z: c    end3 S6 s: o, _( D- B) }, v0 H
end9 J6 c) ^2 [' S1 h* l
' n+ X& a# k1 o8 g. f. N0 v
begin P_pick2 arriving
, B3 W) J2 _  [    set A_i to 11: [) `7 Z5 i9 l/ F7 B: b" S
    move into Q_induct2
+ s) m, y1 k) R    move into pickaisle.induct26 P6 C0 x" H, t: G
    while A_i<=30 do begin3 f: T8 h% ]1 B/ H0 P( x
        travel to pickaisle.con(A_i)
: _- U# D2 {# v5 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _6 P  F$ m7 q: l/ ^) J; p
        else wait for 10 sec
- J+ n5 L1 b7 E- l% i6 ]  F# m# C) u        if A_i=A_leave then send to die" y' r( c0 d5 U  j# z5 M) j
        else inc A_i by 1/ m% a& ?/ u8 p
    end
$ r: J+ O8 U( {6 ?" N+ M9 wend
* i- }2 c' g5 @7 U1 G' F4 X6 z$ p+ f
begin P_pick3 arriving7 S3 E" e& o# |3 u7 [; J  H
    set A_i to 21
0 h& }) P/ L0 I; |0 O2 }- P    move into Q_induct31 C/ v7 A5 b& ^! n4 s9 F2 o3 O- Z
    move into pickaisle.induct3
5 J& q1 t0 u% {( q6 ^0 Q" b    while A_i<=30 do begin% ?+ U: L; V. G+ ~1 j/ e( z& G( O+ H
        travel to pickaisle.con(A_i)
' c$ C0 |' u- c. T% C5 ?6 P% K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 m' A- T: L. x% [
        else wait for 10 sec( C$ A% J0 H- c! K4 I  z, e
        if A_i=A_leave then send to die8 I+ q' n7 s; h8 g* i+ |! e
        else inc A_i by 1' t0 f+ x+ }% Y7 Z8 j5 @2 }2 T
    end
: E  A( y0 r8 h* v. a! cend

最佳答案

查看完整内容

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是个什么东东?
- z  E* D# J& W9 l. w  gmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" U: q$ u2 C' P/ d

7 S/ B4 f! _8 i3 _* g- XAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。( K9 P1 l0 Z; K' d3 z

$ ^8 t; M1 k. ~, M另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  o" W. [: A9 o& N+ l1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# v  F$ I/ k# \" `" Z: Y+ V
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
) X+ b$ l$ y) \/ W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ `" [2 R' o7 @
begin P_induction arriving( {, f  z5 z) L( j
    clone 1 load to P_pick(A_induct)
& g2 H2 I) `' L5 b1 H) qend最大的系
8 V3 u' {% n# ]5 H
6 e- {1 b( D% w( y/ A1 Vbegin P_pick arriving
& g; @4 V2 L" @2 y    set A_i to procindex * 10 + 1& S; n% a$ A9 W: \1 T7 v4 `6 U
    move into Q_induct(procindex)' D# P- C1 X; {$ S
    move into pickaisle.induct(procindex)
( A) r9 u; v. |" Z8 `    /*check the type of pickaisle.induct(i), for your last problem.*/+ J5 @: p3 b2 ?0 {0 e7 t' F2 D

7 F8 K. s# ], ]; M6 J    while A_i<=30 do begin# `  e5 I/ A8 V* N( Y2 h
        travel to pickaisle.con(A_i)
+ u6 @* ]" t0 Q5 c        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?( b4 D' w: ?3 F% Q        else wait for 10 sec
- l' R1 H; C( a  O0 U$ l        if A_i=A_leave then send to die, |4 j/ j2 H; y
        else inc A_i by 17 \8 F3 v; n# k2 \& g
    end
: \- y  p/ Z- O- Mend  l! c- o: ^& z

! i- }( l' g" n9 @$ }其中的procindex为整形,代表当前process的序号。$ V6 `1 }) t) ?
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 09:41 , Processed in 0.016754 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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