设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14856|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% J, r9 D2 y: O! S% O" A2 W
' s0 [) ]6 C; t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 F% X, h: Q+ f% V( N9 R' H
4 q/ s/ @% S& q1 [
begin P_read arriving" J0 a3 |5 I. R
    while 1=1 do begin% x  n" @) j3 L/ V
        read A_tote from "data.txt" with delimiter "\n"9 K$ u4 r7 C9 e$ C* |3 W
        read A_time from "data.txt" with delimiter "\n"
0 g$ _& p; [$ a( r& ^+ [: k        read A_leave from "data.txt" with delimiter "\n"
* p" ~# `' Y, s" T. x7 I        read A_picks from "data.txt" with delimiter "\n"
" o" B4 m% J8 f, j+ y        set load type to A_tote
  B4 m4 N9 f' A2 i1 j        if A_tote="tote 1" then set A_induct to 1  G) [' S0 Y& `8 y6 N
        else if A_tote="tote 2" then set A_induct to 2
* O+ K. J; E: w, f; l            else set A_induct to 3    4 h$ W: h/ G- K: D0 S: P6 f% I% q
        set A_i to 0& S) d& i" o$ ^' e
        clone 1 load to P_induction
) |' h' a5 R+ t. s        wait for A_time sec
) J4 ?8 ^6 ^* T' J# D    end0 ?* E: D+ R; k( a8 f/ `% C
end- j8 \/ t. @$ g) @5 z

+ K+ @: d' Y3 g) C; @; ~! T6 ~: mbegin P_induction arriving8 m3 |' O( x7 Y% \( n: N
    if A_induct=1 then clone 1 load to P_pick19 t( ]$ w) E4 I0 b4 C
    else if A_induct=2 then clone 1 load to P_pick2/ G; T5 ?2 Z7 E8 {' k5 P) {+ @; S
        else clone 1 load to P_pick3
1 [% |4 \- ]5 H# ~end/ I, G- J/ H; ]: |5 t3 P
+ w: ^% r8 ]) _. O2 q/ x& U
begin P_pick1 arriving0 u: U7 F) L+ d! X% }
    set A_i to 1
! x. Q, c; |/ ^* D# J. R# L    move into Q_induct1
8 U9 p( @) j. J4 P) q) Z/ O9 @* W    move into pickaisle.induct1  ?7 z9 J4 g! I" r1 D+ D
    while A_i<=30 do begin
( B/ W/ d( z- J        travel to pickaisle.con(A_i)4 l1 k# k. s9 a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' S# x1 v6 H4 V- [- `1 T
        else wait for 10 sec5 B! Q4 ?5 x- c
        if A_i=A_leave then send to die! R) P% K1 G9 h' C' m! d. k3 ]
        else inc A_i by 1
% o5 v! h; X/ H$ g5 ^0 o    end4 f7 E6 w9 s/ Z0 C0 W
end6 k, ~3 w- F7 ]8 h4 D
( B) x$ R/ ^+ R- y8 d, B7 }
begin P_pick2 arriving
; T) x4 E/ o' X& b2 J    set A_i to 11! J4 p8 J' g) c+ n) v  j) T
    move into Q_induct23 s% _3 M* c  [9 Z. ]. x
    move into pickaisle.induct2% Z5 B( H- X, W5 Y
    while A_i<=30 do begin# W5 j. {( D0 _* W  }
        travel to pickaisle.con(A_i)* g! R: ]! V. b0 x$ Y0 M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, i5 k3 e9 R3 f2 Y
        else wait for 10 sec
7 I* f6 G" ]" H% O* J  ]/ \# f        if A_i=A_leave then send to die0 m( }& X* ~' {; m' P5 C/ Q
        else inc A_i by 1, g3 ~1 d7 R' x$ t& e- Q% A( w
    end- U: V8 G* u! u2 {; }/ j3 Z
end! n% W+ m" B. P! `1 p. L3 {

5 @3 t% ^6 t* @2 |# S8 {begin P_pick3 arriving1 ^7 p( M9 w& J3 I
    set A_i to 21. T( p: m- x" k: N- S- N
    move into Q_induct3
& J) f, [8 ?6 X& ~6 \% D3 _( ^" s    move into pickaisle.induct3
+ s& ?; ?: l& h# Y. |    while A_i<=30 do begin( G9 F2 Z* \9 D6 l% o' I1 k
        travel to pickaisle.con(A_i)) l7 C/ U( x# o8 ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! N: h  j! e2 W8 m: L
        else wait for 10 sec# s6 p; z7 q5 @2 U. @5 y0 G4 l
        if A_i=A_leave then send to die
$ z- \# ~  z! i/ h6 t$ b        else inc A_i by 1
. i' l7 h* ?" f% C    end
4 J  q$ z3 h0 }" Y$ zend

最佳答案

查看完整内容

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是个什么东东?
. ~; u3 d; ]* ]" N! imove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
4 D* L4 f6 o& P  r" z/ {# ]/ l& t/ F1 F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
, P, R9 T; i3 m- E$ o7 _8 z8 J8 r# q7 d& k" A
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" m: M" m! j# c7 e: \" d9 d1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;0 u0 c7 h) ?) U( R1 @& A- S
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ R1 {3 Y/ q8 s/ H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
. l' g! c) N8 ]3 U) W4 s; o# [begin P_induction arriving
; z# C: O( ^, ~3 i! y/ S    clone 1 load to P_pick(A_induct)
& }7 [, {% t( r4 @end最大的系' b+ I0 ]  y  Z, n  Z
! r: {' X. U7 G2 I& C: k- Z
begin P_pick arriving- W. K6 }+ ?+ _* h) k& R/ t
    set A_i to procindex * 10 + 1
- w. B  j' b' L  R* L    move into Q_induct(procindex)- E" L3 P* N3 u: ]) x, s
    move into pickaisle.induct(procindex)9 V2 K) W9 H8 b/ ^1 ]
    /*check the type of pickaisle.induct(i), for your last problem.*/6 {: F0 @4 q; q: e7 a5 R

- {- x# G" R2 A* B2 F" q/ `) L" Y4 o    while A_i<=30 do begin- D; N, [4 q2 U
        travel to pickaisle.con(A_i)1 \1 G7 P% t+ F7 H
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ?" Z( G; X) i9 ]        else wait for 10 sec% o/ Q3 S; A  d$ P; J
        if A_i=A_leave then send to die
% J: o0 S( R4 S5 Z5 j5 p        else inc A_i by 19 Y! M$ p0 ~( }" J! Z- l8 r& [
    end
, j- g1 @, }; Yend) B$ O' x, _& F1 t) r$ @2 Z

! n) s' c+ p0 a其中的procindex为整形,代表当前process的序号。
, O' C/ I0 J% Z; P4 H+ M" ostation和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-29 04:53 , Processed in 0.014771 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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