设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15268|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, X$ L4 r5 l6 s) K1 F$ q8 V/ {; J5 S+ E& y/ J# w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ w' ?, I7 C! y# W
0 ?4 }& X* D$ d  g* Tbegin P_read arriving
+ f  S. W6 @/ ^2 i* e  o; @    while 1=1 do begin3 p9 E9 Q' a% H1 j8 X6 q
        read A_tote from "data.txt" with delimiter "\n"5 A/ p. r& h$ a' }' R+ N% Z; G( }
        read A_time from "data.txt" with delimiter "\n"; R" C; e! ]. j& f: ?  J# h& C
        read A_leave from "data.txt" with delimiter "\n"4 |9 J' ~, l' r* H
        read A_picks from "data.txt" with delimiter "\n"
- @+ z0 w6 t- F        set load type to A_tote
& _+ c; u1 |5 Z  z4 [# _" S        if A_tote="tote 1" then set A_induct to 1% Z1 e0 v, b, d* u9 _
        else if A_tote="tote 2" then set A_induct to 2
, F# `& g. q- ?+ Q) b3 b            else set A_induct to 3    % K2 O, ?, D8 t7 e8 T  ~/ H
        set A_i to 0" h5 b- x8 f3 K# z: w3 E1 _/ D
        clone 1 load to P_induction
7 S0 `, p. f6 G! N2 s* B* w: D        wait for A_time sec4 k, a* i, \& f' w$ H1 L
    end
" t! g, N' Z9 v/ e3 Fend
- o# M' i0 c) A6 ~5 w
5 s) ~4 c$ T, I1 e% G$ }begin P_induction arriving
! q. ^, N+ s1 m: a    if A_induct=1 then clone 1 load to P_pick19 b6 w; P6 U5 A) ]8 F, ^
    else if A_induct=2 then clone 1 load to P_pick2& q* D4 e0 k$ b5 q5 i
        else clone 1 load to P_pick3
; o$ n* O# ^1 Z0 L/ ~8 x- K3 ~end
; ]9 E! ?0 P) q5 h- j4 U9 ?/ \/ I, t' f
begin P_pick1 arriving
6 ?9 l( s" b4 G( f2 Z9 b+ K  [    set A_i to 1
' s2 H- h3 N; d1 ~4 j, n    move into Q_induct1# i7 d* D! j" o+ k. d: W# |
    move into pickaisle.induct1
0 z- p+ b$ e/ W; u+ t! Z" {6 M; h4 I& I7 \    while A_i<=30 do begin
  s# g. y$ L& a. a( Q6 T        travel to pickaisle.con(A_i)8 B8 |: t- g: ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 t/ ~! G7 A! x1 [! K* Z4 N, S& A9 m8 n6 ~        else wait for 10 sec! Q; y, E* w8 D: q6 Z# M1 A
        if A_i=A_leave then send to die
6 W9 |  I: ?1 P5 w0 ~' ~' o        else inc A_i by 1
: m6 S8 S6 D' Z  f& C  b3 \: F    end% j( r% u% Z' ~! p. \4 q
end
  i6 T2 H* B' Y0 V, Q* e/ @1 }8 h# h1 o9 c* A0 N
begin P_pick2 arriving
$ I! O% h/ @/ d  X" ^& C    set A_i to 11
7 c8 \. K9 J) C2 ~; e7 P4 F    move into Q_induct22 W$ M+ ]: t+ c
    move into pickaisle.induct2) I) A! b$ G. Y
    while A_i<=30 do begin6 d1 l2 N" E1 R: H/ h
        travel to pickaisle.con(A_i)+ j) y- V& o8 j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% _, U" ]. {/ U9 L
        else wait for 10 sec2 `. V$ f  j3 m9 w6 Y; w0 V
        if A_i=A_leave then send to die
: g" u" b/ o9 W6 \* a  O1 u        else inc A_i by 17 o: `; h% o6 k0 s% g$ k) O7 Q
    end# O$ n' V9 R4 U5 k$ ~& @! a
end: ]0 K& r' {* q% B7 P& C4 w

0 N  O8 K% S# _9 y; T0 ^* ^begin P_pick3 arriving
" d$ P- E; F- N( h4 x$ i; r. D    set A_i to 21
' q, ]; {7 M9 O7 A/ ], n8 R, t; s    move into Q_induct3
+ G' U: E' w2 K    move into pickaisle.induct3$ d# L  s! D7 P& y: Y' d; T
    while A_i<=30 do begin
' a+ O% N6 O/ d. Q3 X0 F! \        travel to pickaisle.con(A_i)0 m& a9 X) a" y/ A9 m1 S: Q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 e$ n0 w' V/ `; G! ~- f# s& m
        else wait for 10 sec+ M( ?+ L& l1 r' c
        if A_i=A_leave then send to die# @' `& N( U1 o: a+ \
        else inc A_i by 15 }+ _7 W5 \' L4 a/ |$ R
    end: f5 u( _. _4 @5 {8 N! v
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是个什么东东?# F6 z) k. |* Z0 v( c/ z) c+ F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 |+ j" Y0 a0 ]% O( d* j1 s9 |
/ |9 {- `3 T9 @* }6 R& H
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 e3 v2 x7 `8 c6 w

/ i% I. F- F( t  R" [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
7 X( {: V( b0 w  R: {1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
+ L2 b6 A- n" G# O, N4 X2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;0 p  a' v) f. v5 r: E. F
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
( c, D' ?. c1 J2 a, v. Y. ~6 Sbegin P_induction arriving
( f6 L% O% H, D, D, `    clone 1 load to P_pick(A_induct)
- ]4 q# s; I* Kend最大的系
) T, o$ l) n  @$ t8 q0 h9 v- H5 V; N; T  d' I
begin P_pick arriving* W  n& Y# z! B$ J  f
    set A_i to procindex * 10 + 19 A+ ~3 U: k$ D) @8 ^8 O5 H& f( p
    move into Q_induct(procindex)
; ~  d9 G) ~9 N) K6 t: ?    move into pickaisle.induct(procindex). a* v( \- f2 [
    /*check the type of pickaisle.induct(i), for your last problem.*/8 V  o# C. b4 v- W$ Y& d

. B! r) i7 a6 V) z$ y    while A_i<=30 do begin7 ^6 Z2 S4 l& G! l# Q; J$ [
        travel to pickaisle.con(A_i)
1 {3 _' v; Y1 ^" ~* w5 }2 o4 |4 E/ Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z" w+ t" z; Z1 \( A6 ?4 P! J5 ~
        else wait for 10 sec
, x" e0 D; [5 I, z        if A_i=A_leave then send to die
5 g8 j' r# k( P3 f( [2 [; }        else inc A_i by 1
4 {0 f5 w& X% n* [* \" \    end/ H3 {  g, v$ R. ^; J( t1 N
end
2 i7 [' K9 Q5 ~5 E* Y5 f1 {
# h8 n$ i; P- d1 P) u$ s* S! j其中的procindex为整形,代表当前process的序号。+ d( t3 F2 q. U9 Y
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-28 18:50 , Processed in 0.015573 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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